File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed
src/ImageSharp/Formats/Jpeg Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -556,6 +556,12 @@ private JpegColorSpace DeduceJpegColorSpace(byte componentCount)
556556 return JpegColorSpace . RGB ;
557557 }
558558
559+ // If these values are 1-3 for a 3-channel image, then the image is assumed to be YCbCr.
560+ if ( this . Components [ 2 ] . Id == 3 && this . Components [ 1 ] . Id == 2 && this . Components [ 0 ] . Id == 1 )
561+ {
562+ return JpegColorSpace . YCbCr ;
563+ }
564+
559565 // 3-channel non-subsampled images are assumed to be RGB.
560566 if ( this . Components [ 2 ] . VerticalSamplingFactor == 1 && this . Components [ 1 ] . VerticalSamplingFactor == 1 && this . Components [ 0 ] . VerticalSamplingFactor == 1 &&
561567 this . Components [ 2 ] . HorizontalSamplingFactor == 1 && this . Components [ 1 ] . HorizontalSamplingFactor == 1 && this . Components [ 0 ] . HorizontalSamplingFactor == 1 )
You can’t perform that action at this time.
0 commit comments