Re: how to fetch header info of NSData
Re: how to fetch header info of NSData
- Subject: Re: how to fetch header info of NSData
- From: Jonathan Rochkind <email@hidden>
- Date: Tue, 3 Feb 2004 09:57:21 -0600
An image stored as binary data does not generally (or neccesarily)
_include_ any mime content-type information. It's just the straight
binary data of the image---unless the image format includes a header
with mime content-type info, it won't be there---and even if it does,
you'd need to know (or guess) what image format it was in order to
pull it out!
ImageMagick has some routines to guess/identify the type of raw
binary data, for the data types supported by image magick. It looks
at the format of the data, and based on what it knows about the
format of many image types, does a pretty good job of identifying it.
You could theoretically use ImageMagick. But I think you are better
off just storing the mime content-type in the db; that is, in my
opinion, the right way to do it.
--Jonathan
At 2:42 PM +0530 2/3/04, Kranthi Sagar Borra wrote:
I'm trying to store some images . If I
know the width/height of the image and its mime type, there is no
problem to fetch and display the image via WOImage.
My question: Is there any way to retrieve the image mime type from
the data (as NSData) fetched from the database? If so,
then I can get rid of an extra column in the table storing those info
Any ideas? Thanks
Regards,
Kranthi Sagar.
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.