Re: Getting image info without loading entire image
Re: Getting image info without loading entire image
- Subject: Re: Getting image info without loading entire image
- From: Andrew Farmer <email@hidden>
- Date: Fri, 19 Jan 2007 18:18:11 -0800
On 19 Jan 07, at 16:34, Ken Tozier wrote:
On Jan 19, 2007, at 6:06 PM, Ryan Britton wrote:
Have you looked at CGImageSource?
http://developer.apple.com/documentation/GraphicsImaging/Reference/
CGImageSource/Reference/reference.html
Interesting...
Getting the info through CGImage functions like this
<snip>
is *MUCH* faster than getting the same info through NSImageRep like
this.
NSImageRep *img = [NSImageRep imageRepWithContentsOfFile: inPath];
if (img != nil)
{
width = [NSNumber numberWithInt: [img pixelsWide]],
height = [NSNumber numberWithFloat: [img pixelsHigh]];
}
Probably because (I'm pretty sure) the NSImageRep code actually
decompresses the image into a bitmap and measures it, while CGImage
may be able to just read the header.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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