> Also, if you’re already getting a CGImageRef using 
> CGImageSourceCreateImageAtIndex, why not just set imgLayer.contents to the 
> CGImageRef? 

sorry, my previous response regarding this was incomplete. What I am doing is 
this, in order to get the EXIF orientation right:

    CIImage * image = [CIImage imageWithCGImage: imageRef];
    CIImage * orientedimage = [image imageByApplyingOrientation: 
(CGImagePropertyOrientation) img_orientation];
    NSCIImageRep * nsimgrep = [NSCIImageRep imageRepWithCIImage: orientedimage];
    NSImage * nsImage = [[NSImage alloc] initWithSize: nsimgrep.size];
    [nsImage addRepresentation: nsimgrep];
    CALayer * imgLayer    = [CALayer layer]; 
    imgLayer.contents     = nsImage;

Still, is there a better way?

Best regards, Gabriel

_______________________________________________

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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

Reply via email to