• 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: Getting image info without loading entire image
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >Getting image info without loading entire image (From: Ken Tozier <email@hidden>)
 >Re: Getting image info without loading entire image (From: Ryan Britton <email@hidden>)
 >Re: Getting image info without loading entire image (From: Ken Tozier <email@hidden>)

  • Prev by Date: Re: Getting image info without loading entire image
  • Next by Date: Re: Core data confused
  • Previous by thread: Re: Getting image info without loading entire image
  • Next by thread: Re: Getting image info without loading entire image
  • Index(es):
    • Date
    • Thread