geosolutions-it / imageio-ext

Additional plugins and extension for the standard Java ImageIO library
Other
144 stars 83 forks source link

EXTRA_SAMPLES TIFF tag fails on data type BYTE #296

Open MichiHo opened 7 months ago

MichiHo commented 7 months ago

The EXTRA_SAMPLES tag in tiff is mostly documented as being of type SHORT, but in page 118 of the specification the type BYTE is also noted. In our company, we received files from our customer which in fact have this tag stored as BYTE, and while adding it to Geoserver (which uses this library), reading the metadata failed at this location with the message Data not char[], short[], or int[]!.

Given that the spec mentions BYTE for this tag, and it can actually appear in practice, my initial proposal would be to add BYTE support to the getAsInts method - or use a different method that also supports BYTE. As I'm not well acquainted with the codebase of this library, this is of course only a wild guess of a solution.