Re: Extracting filetype info from image
Re: Extracting filetype info from image
- Subject: Re: Extracting filetype info from image
- From: "Diederik Hoogenboom (Eetay)" <email@hidden>
- Date: Fri, 7 Apr 2006 09:32:01 +0200
Try this:
CGImageSourceRef imageSource = CGImageSourceCreateWithURL((CFURLRef)
[NSURL fileURLWithPath:file],nil);
CFDictionaryRef metaDict = CGImageSourceCopyPropertiesAtIndex
(imageSource,0,nil);
CFRelease(imageSource);
metaDict will contain the metadata for the image and can be cast to
NSDictionary *.
Diederik
On 6-apr-2006, at 19:52, Ian was here wrote:
After I've loaded an image file, I would like to
extract such info as it's dpi and whether it's a TIFF,
JPEG, etc... Other than relying on the actual file
extension.
I checked the file attributes of the image before
loading it, and tried getting NSBitmapImageRep
attribute data after loading it. None seem to give the
specific info that I need. Converting an NSImage into
just about any other file format is easy. Extracting
the current file format info is proving to be quite a
challenge.
Thank you.
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden