ngageoint / tiff-java

Tagged Image File Format Java Library
https://ngageoint.github.io/tiff-java
MIT License
72 stars 34 forks source link

A TiffException is thrown on unknown field tag and type values. #23

Closed michaelknigge closed 5 years ago

michaelknigge commented 5 years ago

If an unknown field type value is encountered a TiffException will be thrown immediately. The exception message contains the unknown value. This gives the user a better feedback. If the exception wouldn't be thrown, a NullPointerException would occur just a few lines later (when invoking readFieldValues and i. e. null is given for fieldTag).

Now, when reading a TIFF file and an unsupported compression method is used, a TiffException is thrown only if the caller tries to decompress the image. That allows users of the TIFF-Library just to parse the tiff tags (i. e. a "tiff-dump" utility) and don't care about the used compression.

All JPEG specific tags (that are documented in https://download.osgeo.org/libtiff/doc/TIFF6.pdf) are added. With these additions, the test images contained in https://download.osgeo.org/libtiff/pics-3.8.0.tar.gz could be read (read, NOT decompressed).

bosborn commented 5 years ago

thanks for #25