Hi Ken,

The -colorSpaceName method on NSImageRep returns only a best-effort
approximation.  This method, like many of the methods of NSImageRep,
is used by NSImage to decide which NSImageRep is the best choice for
drawing to a given destination.  The design is easiest to comprehend
from that point of view.  If an image rep doesn't have a 'home'
colorspace, calibrated RGB is the default.

EPS on Mac OS X is handled by converting the data to PDF.  The
interface NSEPSImageRep uses is documented here:
<http://developer.apple.com/documentation/GraphicsImaging/Reference/CGPSConverter/Reference/reference.html>.
 I'm not familiar with the EPS format (since we just convert it to
PDF), but a PDF doesn't have any one colorspace.  Different embedded
bitmaps may have different colorspaces.  We do not look through the
included bitmaps for a most popular colorspace or anything like that.

This is more of an explanation than a workaround.  You can and should
file a bug, but even if you can define exactly what you want to have
happen, you'll have to go it alone for now.

-Ken
Cocoa Frameworks

On Sun, Dec 21, 2008 at 10:04 PM, Ken Tozier <kentoz...@comcast.net> wrote:
> Hi
>
> If you open an eps image in a text editor like BBEdit, you can see clearly
> what color space it was saved as but when you create an NSImage from the
> file and call [image representations] or [image bestRepresentationForDevice:
> <printer device dict here>] all you get are images with
> "NSCalibratedRGBColorSpace." Most of our images are saved as cmyk so why is
> NSImage ignoring that info and replacing it with rgb? Is there any way to
> load eps's differently so that their saved color spaces are preserved? I
> could write a little hack to read the eps header directly and extract the
> info, but I'd like to avoid that if there is a way to do it with NSImage.
>
> Reason I ask is that I wrote a file cataloging application and one critical
> piece of info is the color space, so users will know, at a glance, whether
> an image they are about to import into a print document needs to be
> converted to cmyk.
>
> Thanks for any help
>
> _______________________________________________
>
> 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/kenferry%40gmail.com
>
> This email sent to kenfe...@gmail.com
>
_______________________________________________

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