Re: Cocoa won't draw CMYK jpeg
Re: Cocoa won't draw CMYK jpeg
- Subject: Re: Cocoa won't draw CMYK jpeg
- From: Scott Thompson <email@hidden>
- Date: Wed, 12 Sep 2007 09:30:42 -0500
On Sep 12, 2007, at 9:08 AM, Robert Clair wrote:
Any wisdom or help greatly appreciated.
...Bob Clair
Have you tried, as an experiment, opening the JPEG using Image I/O?
Not yet. I'm vainly hoping for something simpler. :-)
Simpler?!? :-) Ok... it is a shame that there's not an (Apple
provided) NSCGImageImageRep... yet.
NSURL *urlToFile = [NSURL fileURLWithPath:[sheet filename]];
CGImageSourceRef mySource = CGImageSourceCreateWithURL((CFURLRef)
urlToFile)
CGImageRef myImage = CGImageSourceCreateImageAtIndex(mySource, 0, NULL);
CFRelease(mySource);
And then...
CGContextRef *cgContext = (CGContextRef) [[NSGraphicsContext
currentContext] currentPort];
CGContextDrawImage(cgContext, destinationRect, myImage);
The reason I ask is because my understanding was that in Tiger most
graphics paths were going through Image I/O. Certainly I would expect
newer applications like Page '08 and Safari to do that while older
applications (and your code) might be going through a Cocoa path that
has not yet been redirected to go through Image I/O.
It's a theory any way.
Which version of the OS are you working on?
All the results cited are on 10.4.10.
OK... then there is at least the possibility that my "divergent paths"
theory above holds water. If you were on a system that didn't have
Image I/O as an option then it shouldn't.
... Then again, there's a good chance that Image I/O existed on 10.3
and just didn't have a public API ...
:-)
Scott
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden