-
Notifications
You must be signed in to change notification settings - Fork 24
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
Conversation
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.
// 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 |
There was a problem hiding this comment.
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.
// 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[..])), |
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[..])), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Double check if read_u32
and read_u64
here is ok. Based on https://github.com/image-rs/image-tiff/blob/0c54a18e2130bd8e3e897009e1fb59eaaf607c6c/src/decoder/ifd.rs#L438-L442.
Big refactor at #17 means the |
Refactor to use
tiff::decoder::ifd::Value
instead of the in-housecrate::lowlevel::TagValue
enum.Part of #7.