JPG loader: Do proper CMYK conversion

This commit is contained in:
Kim Woelders 2018-07-21 17:20:16 +02:00
parent 1c095fd9be
commit 203a99a51a
1 changed files with 10 additions and 1 deletions

View File

@ -131,7 +131,6 @@ load(ImlibImage * im, ImlibProgressFunction progress,
}
break;
case JCS_RGB:
case JCS_CMYK:
for (x = 0; x < w; x++)
{
*ptr2 = PIXEL_ARGB(0xff, ptr[0], ptr[1], ptr[2]);
@ -139,6 +138,16 @@ load(ImlibImage * im, ImlibProgressFunction progress,
ptr2++;
}
break;
case JCS_CMYK:
for (x = 0; x < w; x++)
{
*ptr2 = PIXEL_ARGB(0xff, ptr[0] * ptr[3] / 255,
ptr[1] * ptr[3] / 255,
ptr[2] * ptr[3] / 255);
ptr += cinfo.output_components;
ptr2++;
}
break;
}
}