It looks like you're just looking at the magic number to determine what type of file you're dealing with. Can't you just use the existing magic infrastructure? That has been around for decades, and should have all of those file types. At the simplest form, simply capture the output from
file $filenameand grab whatever you're looking for from that output. There is also a perl module for using magic without launching file as new process, but I've never used it. I believe it is File::LibMagic.
- doug
In reply to Re: How do I find the type of an image?
by doug
in thread How do I find the type of an image?
by ahmad
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |