Re: How to know image type?

Tech-Archive recommends: Fix windows errors by optimizing your registry



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.



.



Relevant Pages

  • Re: Automated mail merge problem
    ... If you need the new header to work as if it had been generated by a notional extra record in the data source, that might be more difficullt. ... "Peter Jamieson" wrote: ... location of the insertion point might make a difference, ... > I've just being trying again and I do get the problem when automating> this ...
    (microsoft.public.word.mailmerge.fields)
  • Re: Automated mail merge problem
    ... "Peter Jamieson" wrote: ... location of the insertion point might make a difference, ... though the header is not visible in the document. ... Dim MergeDoc As Document ...
    (microsoft.public.word.mailmerge.fields)
  • Re: Automated mail merge problem
    ... I tried the "one record only" scenario thinking perhaps we might end up ... The most obvious to me was showing/hiding using the pilcrow button and the possibility that the precise location of the insertion point might make a difference, ... though the header is not visible in the document. ... > Dim MergeDoc As Document ...
    (microsoft.public.word.mailmerge.fields)
  • Re: Changing top margins & allowing merge
    ... Word MVP FAQ site: http://word.mvps.org ... > have a 2.5-inch top margin on the first page, ... Protecting section 1 so that the insertion point must go into section ... Putting a section break in the header so that the header would be ...
    (microsoft.public.word.pagelayout)
  • Re: Headers & Footers Again!
    ... following all the rules and tutorials on header & footers and setting tabs I ... centre insertion moved right as well! ... Thanks once again for all your patience, advice & observations they are all ... "Suzanne S. Barnhill" wrote: ...
    (microsoft.public.word.newusers)