2023.02.07 00:34 "[Tiff] tiffcrop tool ~ JPEG compression options produce wrong output", by Miguel Medalha

2023.02.07 00:34 "[Tiff] tiffcrop tool ~ JPEG compression options produce wrong output", by Miguel Medalha

The tiffcrop is inverting RGB and YCbCr output when using jpeg compression.

The stated YCbCr default (no format specified) works correctly:

'tiffcrop -c jpeg infile.tiff outfile.tif'              the output is a YCbCr file (default behavior)
'tiffinfo outfile.tif'                               'Photometric Interpretation: YCbCr'

But if we request a specific mode using the proposed 'rgb' and 'raw' jpeg options:

'tiffcrop -c jpeg:raw infile.tiff outfile.tif'  the output is a RGB file
'tiffinfo outfile.tif'                            'Photometric Interpretation: RGB color'

'tiffcrop -c jpeg:rgb infile.tiff outfile.tif'          the output is a YCbCr file
'tiffinfo outfile.tif'                          'Photometric Interpretation: YCbCr'

When we request RGB a YCbCr file is produced, when YCbCr is requested a RGB file is produced.

This has been reported 2 years ago as Issue #228, but still not addressed. Is this considered of lesser importance? I would certainly fix it if I knew how to do it...

I know that the work on libtiff is voluntary, which I very much appreciate and am grateful for. I just thought I would leave a reminder here, in case the issue had just been inadvertently buried in time.

tiffcp does not suffer from this drawback.