Re: How to know image type?
- From: Wyne <Wyne@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Fri, 2 May 2008 08:36:08 -0700
Hi Dave,
Thank you for help!
I just think "Checking Header" may not be accountable. I have inserted a
string of NULL characters at the begin of a bitmap file, so effectively
changed the offset of its header, but the contained image is easily opened by
may software, no influence of my insertion is observed.
"Dave O." wrote:
Open some files of each type in a hex editor and look at the first few bytes.
of each.
That should give you enough information to work with, but to get you going
in the right direction, the first two bytes of all BMP files are "BM".
The few JPEGs I just looked at all start: (Hex)
FF D8 FF E0 00 10 4A 46 49 46 00
Though I would check that either from a reference of by testing loads of
files before using those 11 bytes as a test
You might also find it useful to look at the specification for each
filetype, well the headers at least.
Here are a few sites about file extensions which may be helpful:
http://filext.com
http://pipin.tmd.ns.ac.yu/extra/fileformat/index.html
http://www.cryer.co.uk/filetypes/index.htm
Regards
Dave O.
"Wyne" <Wyne@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:DD674D17-385A-4C4C-8F4B-27AE68ECEF57@xxxxxxxxxxxxxxxx
Hello,
My VB6 application needs to handle a variety of images (e.g. BMP, JPG,
GIF.
...etc.). These images are stored in files. In many cases, these files
don't
have extension name, or have WRONG extension name (for example, file
"XXX.bmp" may contains a JPG image).
Is there a simply way to find the image type contained in a known file?
Thanks.
- Follow-Ups:
- Re: How to know image type?
- From: BeastFish
- Re: How to know image type?
- From: Mike Williams
- Re: How to know image type?
- From: Dave O.
- Re: How to know image type?
- References:
- How to know image type?
- From: Wyne
- Re: How to know image type?
- From: Dave O.
- How to know image type?
- Prev by Date: Re: Using Inno
- Next by Date: Re: How to know image type?
- Previous by thread: Re: How to know image type?
- Next by thread: Re: How to know image type?
- Index(es):
Relevant Pages
|