Browse Source

Fallback to id color deduction for adobe marker

pull/2124/head
Brian Popow 4 years ago
parent
commit
4e84800728
  1. 6
      src/ImageSharp/Formats/Jpeg/JpegDecoderCore.cs

6
src/ImageSharp/Formats/Jpeg/JpegDecoderCore.cs

@ -533,6 +533,12 @@ namespace SixLabors.ImageSharp.Formats.Jpeg
return JpegColorSpace.RGB;
}
// Fallback to the id color deduction: If these values are 1-3 for a 3-channel image, then the image is assumed to be YCbCr.
if (this.Components[2].Id == 3 && this.Components[1].Id == 2 && this.Components[0].Id == 1)
{
return JpegColorSpace.YCbCr;
}
JpegThrowHelper.ThrowNotSupportedColorSpace();
}

Loading…
Cancel
Save