]> git.imager.perl.org - imager.git/commit - jpeg.c
CMYK jpeg images were being read as 4 channel images, even though they
authorTony Cook <tony@develop=help.com>
Fri, 14 Jul 2006 14:57:44 +0000 (14:57 +0000)
committerTony Cook <tony@develop=help.com>
Fri, 14 Jul 2006 14:57:44 +0000 (14:57 +0000)
commit02ea5e4726d139484708f05e1b309799a7b1d922
treef67a85fd71cbc685a1dc0f58f2d81f622cded999
parenta50608d24587505189f15e1c5062539c193c7556
CMYK jpeg images were being read as 4 channel images, even though they
have no alpha channel.

The colors were being transferred directly from the JPEG image data,
this only looked correct because of an old bug in photoshop, kept for
compatibility in later versions.  Photoshop inverts the ink values in
the file, so max cyan coverage is stored at 0, and min as 255, and so
on.

CMYK jpegs are now read as 3 channel images.  The colors are now
converted adjusting for the photoshop bug, cmyk images from the only
other source I have, corel draw 9, are inverted in the same way,
presumably for compatibility with photoshop.

If anyone has an application that produces technically correct CMYK
jpegs, please provide a sample in jpeg and tiff form so I can attempt
to deal with it.

Fixes: http://rt.cpan.org/Ticket/Display.html?id=20416
MANIFEST
jpeg.c
t/t101jpeg.t
testimg/scmyk.jpg [new file with mode: 0644]