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 PROTECTED]> 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 protected])
>
> 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:
> http://lists.apple.com/mailman/options/cocoa-dev/kenferry%40gmail.com
>
> This email sent to [EMAIL PROTECTED]
>
_______________________________________________
Cocoa-dev mailing list ([email protected])
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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com
This email sent to [EMAIL PROTECTED]