Skip to content

Commit bd64e43

Browse files
committed
Add note about subsampling support to decoder
1 parent fa225e8 commit bd64e43

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/decoder/image.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -740,6 +740,12 @@ impl Image {
740740
if matches!(color, ColorType::YCbCr(_)) && self.chroma_subsampling != (1, 1) {
741741
// The JPEG library does upsampling for us and defines its buffers correctly
742742
// (presumably). All other compression schemes are not supported..
743+
//
744+
// NOTE: as explained in <fa225e820b96bef35f01bf4685654beeb4a8df0c> we may be better
745+
// off supporting this tag by consistently upsampling, not by adjusting the buffer
746+
// size. At least as a default this makes more sense and is much more permissive in
747+
// case the compression stream disagrees with the tags (we would not have enough / or
748+
// the wrong buffer layout if we only asked for subsampled planes in a planar layout).
743749
if !matches!(self.compression_method, CompressionMethod::ModernJPEG) {
744750
return Err(TiffError::UnsupportedError(
745751
TiffUnsupportedError::ChromaSubsampling,

0 commit comments

Comments
 (0)