image-tiff icon indicating copy to clipboard operation
image-tiff copied to clipboard

Read Short as u16, SignedShort as i16

Open weiji14 opened this issue 7 months ago • 4 comments

Previously, Short values were read incorrectly as u32 instead of u16, and SignedShort values were read incorrectly as i32 instead of i16.

This PR does the following:

  • Add TiffFormatError::ShortExpected enum variant
  • Correctly cast Type::SHORT as u16 values, and support casting Short to other unsigned types via the into_u32_vec and into_u64_vec methods.
  • Correctly cast Type::SSHORT as i16 values

Fixes #204

weiji14 avatar Jul 22 '24 05:07 weiji14