X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;ds=sidebyside;f=images%2Fio-libjpeg.c;h=8725610d330e5f035c00d61aa48c562c1a5c0e17;hb=25541ea3bb96e9f143f0e23f8ac5b432f2f6f47a;hp=be394c95b393a9152fe300c60bd1adbdc9391e30;hpb=bf5edbdd5b56a0d2e239e96dd476c7a9a562506a;p=libucw.git diff --git a/images/io-libjpeg.c b/images/io-libjpeg.c index be394c95..8725610d 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" @@ -358,38 +358,29 @@ libjpeg_read_data(struct image_io *io) uns read_flags = io->flags; /* Select color space */ - switch (read_flags & IMAGE_COLOR_SPACE) + switch (i->cinfo.jpeg_color_space) { - case COLOR_SPACE_GRAYSCALE: - i->cinfo.out_color_space = JCS_GRAYSCALE; - break; - case COLOR_SPACE_YCBCR: + case JCS_GRAYSCALE: + read_flags = (read_flags & ~IMAGE_COLOR_SPACE & IMAGE_CHANNELS_FORMAT) | COLOR_SPACE_YCBCR; + i->cinfo.out_color_space = JCS_YCbCr; + break; + case JCS_YCbCr: + read_flags = (read_flags & ~IMAGE_COLOR_SPACE & IMAGE_CHANNELS_FORMAT) | COLOR_SPACE_YCBCR; i->cinfo.out_color_space = JCS_YCbCr; break; - case COLOR_SPACE_CMYK: + case JCS_CMYK: + read_flags = (read_flags & ~IMAGE_COLOR_SPACE & IMAGE_CHANNELS_FORMAT) | COLOR_SPACE_CMYK; i->cinfo.out_color_space = JCS_CMYK; break; - case COLOR_SPACE_YCCK: + 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: - switch (i->cinfo.jpeg_color_space) - { - case JCS_CMYK: - read_flags = (read_flags & ~IMAGE_COLOR_SPACE & IMAGE_CHANNELS_FORMAT) | COLOR_SPACE_CMYK; - 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; - i->cinfo.out_color_space = JCS_RGB; - break; - } + read_flags = (read_flags & ~IMAGE_COLOR_SPACE & IMAGE_CHANNELS_FORMAT) | COLOR_SPACE_RGB; + i->cinfo.out_color_space = JCS_RGB; break; - } + } /* Prepare the image */ struct image_io_read_data_internals rdi;