As the tiff header includes information on the PhotometricInterpretation and necessary parameters for colour conversion, my ideal solution would be to provide an option to ensure that jpeg-decoder doesn't do any form of colour correction/conversion and simply passes back the decompressed data, so that this can be handled by the image-tiff library (https://github.com/image-rs/image-tiff). Does that sound reasonable? If so I can propose a PR.
The approach sounds good, in particular ensuring that Upsampler::upsample_and_interleave_row is passed a no-op for its color_convert, and a PR would be great.
Decompressing JPEG encoded .tiff files causes incorrect colour conversion (e.g. https://github.com/image-rs/image-tiff/issues/124). This has been temporarily resolved by modifying the JPEG header before being passed to
jpeg-decoder
(see https://github.com/image-rs/image-tiff/pull/148). This is not an ideal solution and feels somewhat hacky.As the tiff header includes information on the
PhotometricInterpretation
and necessary parameters for colour conversion, my ideal solution would be to provide an option to ensure thatjpeg-decoder
doesn't do any form of colour correction/conversion and simply passes back the decompressed data, so that this can be handled by the image-tiff library (https://github.com/image-rs/image-tiff). Does that sound reasonable? If so I can propose a PR.