fire-eggs / YAIV

"Yet Another Image Viewer"
MIT License
3 stars 0 forks source link

Jpeg Image load failure : CMYK profile #32

Open fire-eggs opened 3 years ago

fire-eggs commented 3 years ago

The attached image does not load OK - hits the setjmp() clause in Fl_JPEG_Image.cxx. It loads OK in other programs.

590B-01.jpg.zip

rageworx commented 3 years ago

Yes you're right, FLTK default jpeg cannot load this image. I'll be test with TurboJPEG.

rageworx commented 3 years ago

turbojpeg return -1 to decode tjDecompress2().

image

checked for detail error string with tjGetErrorStr(), and result -

image

589B-01.jpg has CMYK,ICC ( not YUV ) color space.

image

rageworx commented 3 years ago

Just made for a test converting CMYK to RGB, and result ...

image

by wikipedia,

FIF is compatible with Adobe Photoshop's JPEG "Information Resource Block" extensions, and IPTC Information Interchange Model metadata, since JFIF does not preclude other application segments, and the Photoshop extensions are not required to be the first in the file. However, Photoshop generally saves CMYK buffers as four-component "Adobe JPEGs" that are not conformant with JFIF. Since these files are not in a YCbCr color space, they are typically not decodable by Web browsers and other Internet software.

rageworx commented 3 years ago

CMYK need icc profile, parser may here. can't render right color without profile...

here a CMYK.icc profile.

cmyk.zip

rageworx commented 3 years ago

Testing source is here,

turbojpeg2flimg.zip

I wish you can make perfect CMYK to RGB converter with icc profile.

fire-eggs commented 3 years ago

All useful info! This was an ImageGlass testing image, not a high priority for me. But it did find my failure to handle image failure, so all good. I'll poke at CMYK handling as we go along...

fire-eggs commented 7 months ago

Recent instances of CMYK: db2020w/5558513.jpg dpix/Wallpaper/2Qg3FpS.jpg