Convert and Image Order
Posted: 2019-09-27T06:35:47-07:00
Hello, All,
I work for a cultural heritage institution that is converting a large number of TIFF files to JP2 to reduce our storage footprint. In order to ensure the validity of the conversion, I am using the "compare" function ('compare -metric AE [original.tif] [converted.jp2] null:'). I am looking for a result of 0, meaning presumably that there are no different pixels between the original and the derivative.
I have noticed that a number of our TIFF's have thumbnails embedded in IFD1. For those images, if I run the comparison using the TIFF as the first argument, the result is that none of the pixels match. However, if I use the JP2 as the first argument, the comparison shows that all the pixels match.
I also ran the comparison after stripping out the IDF1 thumbnail using ExifTool ('exiftool -IFD1:all= -m [original.tif]'). Again, the comparison fails if I run it with the original first, but succeeds if I run it with the stripped file first.
Obviously, the presence of the thumbnail affects the comparison, but so does the order of the input images on the command line - I'd like to know more about why, and why switching the order of input images changes the result. I need to know whether the check is valid.
Can anyone explain how the compare function determines what to compare and why it seems to include or omit IFD1 depending on whether that image is the first or second argument position?
Thanks for any insight you can provide.
–Dean Smith
I work for a cultural heritage institution that is converting a large number of TIFF files to JP2 to reduce our storage footprint. In order to ensure the validity of the conversion, I am using the "compare" function ('compare -metric AE [original.tif] [converted.jp2] null:'). I am looking for a result of 0, meaning presumably that there are no different pixels between the original and the derivative.
I have noticed that a number of our TIFF's have thumbnails embedded in IFD1. For those images, if I run the comparison using the TIFF as the first argument, the result is that none of the pixels match. However, if I use the JP2 as the first argument, the comparison shows that all the pixels match.
I also ran the comparison after stripping out the IDF1 thumbnail using ExifTool ('exiftool -IFD1:all= -m [original.tif]'). Again, the comparison fails if I run it with the original first, but succeeds if I run it with the stripped file first.
Obviously, the presence of the thumbnail affects the comparison, but so does the order of the input images on the command line - I'd like to know more about why, and why switching the order of input images changes the result. I need to know whether the check is valid.
Can anyone explain how the compare function determines what to compare and why it seems to include or omit IFD1 depending on whether that image is the first or second argument position?
Thanks for any insight you can provide.
–Dean Smith