Cocoa has problems with CMYK jpegs. Going from Tiger to Leopard it became ambivalent about whether a CMYK pixel value of 0, 0, 0, 0 meant black or white. (I remember reading somewhere that there is an ambiguity in the jpeg standard.)

You can see this with Preview. Get yourself a CMYK tiff file and convert it to jpeg using *Leopard's* Preview. Note the ugly black result. If you open that jpeg in other Apple apps (Mail, etc) it also displays as inverted. Adobe somehow can deal with files written either way - that jpeg will appear normal if you open it in Photoshop.

My own app writes CMYK jpegs from an NSBitmapImageRep by doing

NSData* outData = [bitmapRep representationUsingType: NSJPEGFileType properties: propDict];

It showed the same issue. Since the app had to work on both Tiger and Leopard, I fixed the problem by writing out a tiny all-white jpeg to a temp file when the program starts. I then read it back in and set a flag based on whether what was read in matches what was written out. If it doesn't, I set a flag and then invert all the pixels before writing out a a CMYK jpeg. So far so good.

On to Snow Leopard.

Now take the CMYK tiff and convert it to jpeg on Snow Leopard. Notice that the result is not only inverted but what isn't totally black is now green. If you open this jpeg with Photoshop it is not inverted but it is still very green.

My app shows the same thing. Looking at the results I would guess that the color "transform" that is making it green is not reversible.

I will file a bug.

Bob Clair



_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to