mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-01-16 04:16:35 +03:00
use mode structs in JpegEncode.c
This commit is contained in:
parent
6f127e0f53
commit
68028fd513
|
@ -114,7 +114,7 @@ ImagingJpegEncode(Imaging im, ImagingCodecState state, UINT8 *buf, int bytes) {
|
||||||
break;
|
break;
|
||||||
case 24:
|
case 24:
|
||||||
context->cinfo.input_components = 3;
|
context->cinfo.input_components = 3;
|
||||||
if (strcmp(im->mode, "YCbCr") == 0) {
|
if (im->mode == IMAGING_MODE_YCbCr) {
|
||||||
context->cinfo.in_color_space = JCS_YCbCr;
|
context->cinfo.in_color_space = JCS_YCbCr;
|
||||||
} else {
|
} else {
|
||||||
context->cinfo.in_color_space = JCS_RGB;
|
context->cinfo.in_color_space = JCS_RGB;
|
||||||
|
@ -124,7 +124,7 @@ ImagingJpegEncode(Imaging im, ImagingCodecState state, UINT8 *buf, int bytes) {
|
||||||
context->cinfo.input_components = 4;
|
context->cinfo.input_components = 4;
|
||||||
context->cinfo.in_color_space = JCS_CMYK;
|
context->cinfo.in_color_space = JCS_CMYK;
|
||||||
#ifdef JCS_EXTENSIONS
|
#ifdef JCS_EXTENSIONS
|
||||||
if (strcmp(context->rawmode, "RGBX") == 0) {
|
if (context->rawmode == IMAGING_RAWMODE_RGBX) {
|
||||||
context->cinfo.in_color_space = JCS_EXT_RGBX;
|
context->cinfo.in_color_space = JCS_EXT_RGBX;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue
Block a user