Re: image type of the AdressBook image data
Re: image type of the AdressBook image data
- Subject: Re: image type of the AdressBook image data
- From: "Ken Ferry" <email@hidden>
- Date: Tue, 5 Aug 2008 01:08:04 -0700
You can use the ImageIO framework to do this:
CGImageSourceRef isrc = CGImageSourceCreateWithData((CFDataRef)data, NULL);
if (isrc) {
CFStringRef imageType = CGImageSourceGetType(isrc);
// see if imageType is among known types such as kUTTypeJPEG,
kUTTypeTIFF, kUTTypePNG
CGImageSourceRelease(isrc);
}
-Ken
On Tue, Aug 5, 2008 at 12:36 AM, Wayne Shao <email@hidden> wrote:
> Hello,
>
> from "Address Book Objective-C Framework Reference"
> http://developer.apple.com/documentation/UserExperience/Reference/AddressBook/Classes/ABPerson_Class/Reference/Reference.html#//apple_ref/occ/instm/ABPerson/imageData
>
> The imageData method returns NSData*. Is there anyway to know the
> image type (e.g, PNG, TIFF, or JPEG) of the data?
>
> Wayne
> _______________________________________________
>
> 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
>
_______________________________________________
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