Menu

#78 Doesn't like some TIFF files

v1.0 (example)
open
None
5
2019-04-23
2019-04-23
Some Guy
No

ImageJ is a very popular for viewing, analyzing, and editing technical images. AS intense as ImageJ is, it omits a "required" TIFF tag when saving TIFF images, for many years now: tag 259 or 0x103, "Compression". Most software reads such files with no objection, casually assuming that no Compression tag means the same as specifying "no compression". TIFF readers that I have coded only object if tag 259 is present and not equal to 1. But when OptiPNG sees a TIFF file with no Compression tag, it says "Error: Unsupported compression method in TIFF file". It would be nice if OptiPNG would interpret no Compression tag to mean "no compression".
(Normal values for tag 259 are: 1 = no compression. 32773 = PackBits. 5 = LZW. 6 = JPEG. For bi-level files (1bit per pixel): 2 = CCITT; 3 = T4; 4 = T6. Added later: 8 = deflate/zlib. 32895 =IT8 uncompressed. 32896 = IT8 linework compression.)

MATLAB by default writes files with "PackBits" compression 32773. I don't expect OptiPNG to add support for this one, unless it comes "free" with some library. The work-around is to tell MATLAB to write uncompressed TIFF files with a statment like this: imwrite(arrayname, 'outputfilename.tif', 'Compression', 'none');. I only mention this because it led me to the problem with ImageJ. OptiPNG wouldn't process a TIFF written by MATLAB, so I opened it and re-saved it using ImageJ, and OptiPNG still would not process it.

Discussion

  • Cosmin Truta

    Cosmin Truta - 2019-04-23
    • assigned_to: Cosmin Truta
     
  • Cosmin Truta

    Cosmin Truta - 2019-04-23

    Thank you for the report. It is easy to account for a missing compression field, meaning "no compression", and I'll do that in the next OptiPNG release.

    You are right: I cannot invest in implementing support for compressed TIFF, unfortunately.

     
  • Cosmin Truta

    Cosmin Truta - 2019-04-23

    One more thing: if you're willing to disclose your identity, I'd be glad to give credit for your feature request.

     

Log in to post a comment.