• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Cocoa won't draw CMYK jpeg
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: Cocoa won't draw CMYK jpeg
      • From: Robert Clair <email@hidden>
    • Re: Cocoa won't draw CMYK jpeg
      • From: Robert Clair <email@hidden>
References: 
 >Cocoa won't draw CMYK jpeg (From: Robert Clair <email@hidden>)
 >Re: Cocoa won't draw CMYK jpeg (From: Scott Thompson <email@hidden>)
 >Re: Cocoa won't draw CMYK jpeg (From: Robert Clair <email@hidden>)

  • Prev by Date: Re: Questions for a new mac developer...
  • Next by Date: Re: Cocoa won't draw CMYK jpeg
  • Previous by thread: Re: Cocoa won't draw CMYK jpeg
  • Next by thread: Re: Cocoa won't draw CMYK jpeg
  • Index(es):
    • Date
    • Thread