-
Notifications
You must be signed in to change notification settings - Fork 80
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
Tags of type Short are read as Unsigned #204
Comments
This makes sense to fix, though the annoying part is figuring out whether anywhere else in the code is relying on the current behavior. Or whether it is likely to break any downstream users and thus might warrant additional caution |
It looks like a minimal fix is something like so. This will make all the tests run successfully. Regarding side effects I would suppose anyone interfering with the TAG data directly might have colliding types. What use case brought you to this, @lgpasquale ? I suppose taking care of SSHORT is needed as well? This would require introducing an additional Value: pub enum Value {
Byte(u8),
Short(u16),
Signed(i32),
SignedBig(i64),
Unsigned(u32),
UnsignedBig(u64),
Float(f32),
Double(f64),
List(Vec<Value>),
Rational(u32, u32),
RationalBig(u64, u64),
SRational(i32, i32),
SRationalBig(i64, i64),
Ascii(String),
Ifd(u32),
IfdBig(u64),
} |
Adding support for |
When reading a tag that fits into the offset field and is of type
SHORT
(Tiff type 3) the value is returned asValue::Unsigned
instead ofValue::Short
.I believe the issue lies in line 407 of ifd.rs.
The right behavior is what can be seen when multiple values are handled (line 475 of ifd.rs)
The text was updated successfully, but these errors were encountered: