Re: Determining image file types
Re: Determining image file types
- Subject: Re: Determining image file types
- From: Robert Cerny <email@hidden>
- Date: Thu, 10 Jun 2004 17:29:44 +0200
Hi,
somebody on this list recommended using command "file" and parse it's
output.
Robert
Eventually, you can check file /usr/share/file/magic
On 10.6.2004, at 14:44, Freek Dijkstra wrote:
On 10-06-2004 13:41, "Michael Becker" <email@hidden> wrote:
How can I check a file whether it is a valid JPEG image?
I do not know if there is a nice and clean Cocao method to do this.
However, if there is not, I recommend to look at the file signature.
I'm sure the standard is on the web somewhere -- you should look for
"JFIF"
somewhere in the first bytes. Be sure that if you decide to choose this
approach to support all types of JPEG files. I recall there is a new
formatl, JPEG 2000, and you may either explicitly decide to or not to
allow
that format. (And if you don't find the specs, have a look yourself
with
GraphicConvertor and a simple HexEditor).
Regards,
Freek
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.