From bd64e438a423589c37902681e9a6023fef8036de Mon Sep 17 00:00:00 2001 From: "A. Molzer" <5550310+197g@users.noreply.github.com> Date: Mon, 5 Jan 2026 21:46:59 +0100 Subject: [PATCH] Add note about subsampling support to decoder --- src/decoder/image.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/decoder/image.rs b/src/decoder/image.rs index 0150e4d..a1bda19 100644 --- a/src/decoder/image.rs +++ b/src/decoder/image.rs @@ -740,6 +740,12 @@ impl Image { if matches!(color, ColorType::YCbCr(_)) && self.chroma_subsampling != (1, 1) { // The JPEG library does upsampling for us and defines its buffers correctly // (presumably). All other compression schemes are not supported.. + // + // NOTE: as explained in we may be better + // off supporting this tag by consistently upsampling, not by adjusting the buffer + // size. At least as a default this makes more sense and is much more permissive in + // case the compression stream disagrees with the tags (we would not have enough / or + // the wrong buffer layout if we only asked for subsampled planes in a planar layout). if !matches!(self.compression_method, CompressionMethod::ModernJPEG) { return Err(TiffError::UnsupportedError( TiffUnsupportedError::ChromaSubsampling,