image-tiff
image-tiff copied to clipboard
Add SignedByte and SignedShort enum variants
Support SignedByte (i8) and SignedShort (i16) types by:
- Adding
tiff::decoder::ifd::Value::SignedByte
andtiff::decoder::ifd::Value::SignedShort
enum variants - Adding
TiffFormatError::SignedByteExpected
andTiffFormatError::SignedShortExpected
enum variants - Adding two new
into_i8
andinto_i16
methods underimpl Value
insrc/decoder/ifd.rs
Also included two new TIFF files to test roundtrip decoding/encoding:
-
tests/images/minisblack-1c-i8b.tiff
- Created using
gdal_translate -ot Int8 -co PIXELTYPE=SIGNEDBYTE -scale 0 255 \-128 128 tests/images/minisblack-1c-8b.tiff tests/images/minisblack-1c-i8b.tiff
- Created using
-
tests/images/minisblack-1c-i16b.tiff
- Created using
gdal_translate -ot Int16 -co PIXELTYPE=SIGNEDBYTE -scale 0 65536 \-32767 32767 tests/images/minisblack-1c-16b.tiff tests/images/minisblack-1c-i16b.tiff
- Created using
References:
- Page 16 in https://download.osgeo.org/libtiff/doc/TIFF6.pdf
Addresses https://github.com/image-rs/image-tiff/issues/204#issuecomment-1708003609