gwlucastrig commented on PR #311:
URL: https://github.com/apache/commons-imaging/pull/311#issuecomment-1685286696
In answer to your question, 6 and 7 are integer codes that are embedded in a
TIFF file to indicate which kind of data compression it uses. There are a
family of static variables defined in TiffConstants that define the codes for a
compression. In a more modern implementation, we would probably opt to define
the compression option using an enumeration, but the original authors wrote the
TIFF code was written a long time ago, before Java enumerations really caught
on. Also, a constant for JPEG=7 isn't even defined in TiffConstants, only 6.
Which is ironic since 6 was already obsolete in the 90's and option 7 was
formally described in 2002 (see TIFF 6.0, Part 2: TIFF Extensions).
I selected the TIFF constants in my pull request based on the idea of making
as few changes to the code base as possible. I am currently implementing
support for JPEG (see IMAGING-194, IMAGING-240) and wanted to pave the way for
the code change coming in the future. Since there was no constant for JPEG in
TiffConstants, I needed to add one. I wanted to stay within the style
established by the original authors. Also, the TIFF format is pretty settled
(again, JPEG was specified in 2002), and I don't think there will be much
change in the future in terms of new RFC's etc.
Again, the number 7 is not a "version" per se. It's a code embedded into
TIFF files to indicate what kind of data compression they use. The number 8,
for example, indicates the DEFLATE (ZIP) format. The number 6 is the old LZW
compression. The next one after 8 is 32773 for PACKBITS. So there is no
sequential scheme for numbering things. Formats like JPEG 2002 were never
adopted by the TIFF community.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]