X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;f=images%2Fio-libjpeg.c;h=16f10b7a46ef3f39853089d948e0b9646bbb9bd9;hb=ff63510605a8dfc41efb908015364152fa676d9b;hp=70efc91410ff5ea639732fb45f3d94d47c54c8a1;hpb=04d90ed2d8ca25ca147b4c3e731857c3747b79cf;p=libucw.git diff --git a/images/io-libjpeg.c b/images/io-libjpeg.c index 70efc914..16f10b7a 100644 --- a/images/io-libjpeg.c +++ b/images/io-libjpeg.c @@ -9,9 +9,9 @@ #undef LOCAL_DEBUG -#include "lib/lib.h" -#include "lib/mempool.h" -#include "lib/fastbuf.h" +#include "ucw/lib.h" +#include "ucw/mempool.h" +#include "ucw/fastbuf.h" #include "images/images.h" #include "images/error.h" #include "images/color.h" @@ -377,7 +377,11 @@ libjpeg_read_data(struct image_io *io) { case JCS_CMYK: read_flags = (read_flags & ~IMAGE_COLOR_SPACE & IMAGE_CHANNELS_FORMAT) | COLOR_SPACE_CMYK; - i->cinfo.out_color_space = JCS_YCbCr; + i->cinfo.out_color_space = JCS_CMYK; + break; + case JCS_YCCK: + read_flags = (read_flags & ~IMAGE_COLOR_SPACE & IMAGE_CHANNELS_FORMAT) | COLOR_SPACE_YCCK; + i->cinfo.out_color_space = JCS_YCCK; break; default: read_flags = (read_flags & ~IMAGE_COLOR_SPACE & IMAGE_CHANNELS_FORMAT) | COLOR_SPACE_RGB; @@ -539,6 +543,7 @@ libjpeg_write(struct image_io *io) } i.cinfo.input_components = color_space_channels[img->flags & IMAGE_COLOR_SPACE]; jpeg_set_defaults(&i.cinfo); + jpeg_set_colorspace(&i.cinfo, i.cinfo.in_color_space); if (io->jpeg_quality) jpeg_set_quality(&i.cinfo, MIN(io->jpeg_quality, 100), 1); if (io->exif_size)