NSBitmapImageRep orientation?
NSBitmapImageRep orientation?
- Subject: NSBitmapImageRep orientation?
- From: Jean-Nicolas Jolivet <email@hidden>
- Date: Fri, 12 Dec 2008 16:55:34 -0500
I'm re-sizing some NSBitmapImage reps (mostly JPGs or RAW, both full-
size images straight from a digital camera)...
I'm working almost exclusively with NSBitmapImageRep (using
[NSGraphicsContext graphicsContextWithBitmapImageRep:] when drawing
etc..)
With some images( the ones I took with my Canon camera) the
orientation is automatically handled (i.e. Portrait images are rotated
automatically) without me doing anything! I'm just re-sizing them and
they get rotated automatically!
With other images (JPGs and NEF images that I took with my Nikon cam),
it doesn't happen...
Now I was wondering, how am I supposed to deal with this inconsistent
behavior? Especially if I want to rotate my pictures automatically
when I re-draw them...
I'm able to get the Image orientation using a CGImageSourceRef and the
kCGImagePropertyOrientation property.. and that property seems to give
a correct value with all the images I tried... my first instinct was
to use this property and rotate the picture if needed (i.e. if the
orientation is != 1... rotate accordingly)... but it definitely
wouldn't work with my Canon pictures, which somehow get rotated
automatically without me having to do anything... (i.e. if I read the
kCGImagePropertyOrientation and see that it's not equal to 1, I rotate
the picture... which has already been rotated automatically... so I
end up with an image that has been rotated twice...)....
Is there any reliable way I can rotate my images to the correct
orientation ??
Jean-Nicolas Jolivet
email@hidden
http://www.silverscripting.com
_______________________________________________
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