Arguably it doesn't make much sense for non-chroma components to be
subsampled (which is why this type of image was overlooked in
cd7c3e6672cce3779450c6dd10d0d70b0c2278b2-- I didn't realize it was a
thing), but certain Adobe applications apparently generate these images.
Fixes #236
+2.0.0
+=====
+
+### Significant changes relative to 2.0 beta1:
+
+1. The TurboJPEG API can now decompress CMYK JPEG images that have subsampled M
+and Y components (not to be confused with YCCK JPEG images, in which the C/M/Y
+components have been transformed into luma and chroma.) Previously, an error
+was generated ("Could not determine subsampling type for JPEG image") when such
+an image was passed to `tjDecompressHeader3()`, `tjTransform()`,
+`tjDecompressToYUVPlanes()`, `tjDecompressToYUV2()`, or the equivalent Java
+methods.
+
+
1.5.90 (2.0 beta1)
==================
{
if (cs == TJCS_YCbCr)
return (char *)subNameLong[subsamp];
- else if (cs == TJCS_YCCK) {
+ else if (cs == TJCS_YCCK || cs == TJCS_CMYK) {
snprintf(buf, 80, "%s %s", csName[cs], subNameLong[subsamp]);
return buf;
} else
for (k = 1; k < dinfo->num_components; k++) {
int href = 1, vref = 1;
- if (dinfo->jpeg_color_space == JCS_YCCK && k == 3) {
+ if ((dinfo->jpeg_color_space == JCS_YCCK ||
+ dinfo->jpeg_color_space == JCS_CMYK) && k == 3) {
href = tjMCUWidth[i] / 8; vref = tjMCUHeight[i] / 8;
}
if (dinfo->comp_info[k].h_samp_factor == href &&
for (k = 1; k < dinfo->num_components; k++) {
int href = tjMCUHeight[i] / 8, vref = tjMCUWidth[i] / 8;
- if (dinfo->jpeg_color_space == JCS_YCCK && k == 3) {
+ if ((dinfo->jpeg_color_space == JCS_YCCK ||
+ dinfo->jpeg_color_space == JCS_CMYK) && k == 3) {
href = vref = 2;
}
if (dinfo->comp_info[k].h_samp_factor == href &&