Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Use tiff ifd Value enum from tiff crate #15

Closed
wants to merge 1 commit into from

Conversation

weiji14
Copy link
Member

@weiji14 weiji14 commented Jul 22, 2024

Refactor to use tiff::decoder::ifd::Value instead of the in-house crate::lowlevel::TagValue enum.

Part of #7.

Use tiff::decoder::ifd::Value (https://docs.rs/tiff/0.9.1/tiff/decoder/ifd/enum.Value.html) instead of the TagValue enum in src/lowlevel.rs. Note that SignedByte and SignedShort variants are currently commented out, wait for image-rs/image-tiff#234. Also fixed some clippy warnings.
@weiji14 weiji14 added this to the v0.1.0 milestone Jul 22, 2024
@weiji14 weiji14 self-assigned this Jul 22, 2024
Comment on lines +136 to +138
// Type::SBYTE => Value::SignedByte(vec[0] as i8), // TODO wait for upstream SignedByte enum variant
Type::UNDEFINED => Value::Byte(0),
// Type::SSHORT => Value::SignedShort(Endian::read_i16(&vec[..])), // TODO wait for upstream SignedShort enum variant
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO uncomment these lines once SignedByte and SignedShort variants are done in image-rs/image-tiff#234.

Suggested change
// Type::SBYTE => Value::SignedByte(vec[0] as i8), // TODO wait for upstream SignedByte enum variant
Type::UNDEFINED => Value::Byte(0),
// Type::SSHORT => Value::SignedShort(Endian::read_i16(&vec[..])), // TODO wait for upstream SignedShort enum variant
Type::SBYTE => Value::SignedByte(vec[0] as i8),
Type::UNDEFINED => Value::Byte(0),
Type::SSHORT => Value::SignedShort(Endian::read_i16(&vec[..])),

@weiji14 weiji14 changed the title Use tiff ifd Value enum from tiff crate WIP: Use tiff ifd Value enum from tiff crate Jul 22, 2024
Comment on lines +146 to +149
Type::IFD => Value::Ifd(Endian::read_u32(&vec[..])),
Type::LONG8 => unimplemented!(),
Type::SLONG8 => unimplemented!(),
Type::IFD8 => unimplemented!(),
Type::IFD8 => Value::IfdBig(Endian::read_u64(&vec[..])),
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@weiji14
Copy link
Member Author

weiji14 commented Sep 23, 2024

Big refactor at #17 means the vec_to_tag_value method is not used anymore, so closing.

@weiji14 weiji14 closed this Sep 23, 2024
@weiji14 weiji14 deleted the use-upstream-tiff-ifd-value-enum branch September 23, 2024 06:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant