CMYK images are ignored
on behalf of Afli; see issue 809
This commit is contained in:
@@ -352,7 +352,6 @@ int ImageIO::loadJPEG (Glib::ustring fname) {
|
|||||||
cinfo.err = my_jpeg_std_error(&jerr);
|
cinfo.err = my_jpeg_std_error(&jerr);
|
||||||
jpeg_create_decompress(&cinfo);
|
jpeg_create_decompress(&cinfo);
|
||||||
|
|
||||||
|
|
||||||
my_jpeg_stdio_src (&cinfo,file);
|
my_jpeg_stdio_src (&cinfo,file);
|
||||||
if ( setjmp(((rt_jpeg_error_mgr*)cinfo.src)->error_jmp_buf) == 0 )
|
if ( setjmp(((rt_jpeg_error_mgr*)cinfo.src)->error_jmp_buf) == 0 )
|
||||||
{
|
{
|
||||||
@@ -367,6 +366,12 @@ int ImageIO::loadJPEG (Glib::ustring fname) {
|
|||||||
//jpeg_stdio_src(&cinfo,file);
|
//jpeg_stdio_src(&cinfo,file);
|
||||||
jpeg_read_header(&cinfo, TRUE);
|
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;
|
unsigned int proflen;
|
||||||
delete loadedProfileData;
|
delete loadedProfileData;
|
||||||
loadedProfileData = NULL;
|
loadedProfileData = NULL;
|
||||||
|
Reference in New Issue
Block a user