CMYK images are ignored

on behalf of Afli; see issue 809
This commit is contained in:
Oliver Duis
2011-07-02 19:14:31 +02:00
parent b173160f50
commit 5c19de21ca

View File

@@ -352,7 +352,6 @@ int ImageIO::loadJPEG (Glib::ustring fname) {
cinfo.err = my_jpeg_std_error(&jerr);
jpeg_create_decompress(&cinfo);
my_jpeg_stdio_src (&cinfo,file);
if ( setjmp(((rt_jpeg_error_mgr*)cinfo.src)->error_jmp_buf) == 0 )
{
@@ -366,6 +365,12 @@ int ImageIO::loadJPEG (Glib::ustring fname) {
//jpeg_stdio_src(&cinfo,file);
jpeg_read_header(&cinfo, TRUE);
//if JPEG is CMYK, then abort reading
if (cinfo.jpeg_color_space == JCS_CMYK || cinfo.jpeg_color_space == JCS_YCCK) {
jpeg_destroy_decompress(&cinfo);
return IMIO_READERROR;
}
unsigned int proflen;
delete loadedProfileData;