Read image type from binary file

K

kaiserd

I am doing some web development and have some binary image files (that
came from a previous developer) that need to be read and identified as
the correct image type (jpg, bmp or whatever they are) so they can be
displayed on the web.

In research, I found that jpegs often start with 0xFFD8 when you look
at the binary bytes of the files to identify the beginning of the exif
header. I also found that TIFF files start with certain byte alignment
headers (such as 0x4949).

I don't know what types of images these binary files are; however, I
know that they are some type of image (maybe an uncommon one) stored in
a database.

The first few bytes of one of the files reads 0x56534B335743504B.

Is there some way that an image type can be identified from its binary
code? Perhaps a table that lists the binary headers for most images?

Any help would be greatly appreciated.

Thanks
 
D

DatabaseBen

thats an interesting question
of which i dont have an
exact answer. However,
maybe these suggestions may
help with the pursuit.

one might be to get a
fancy tool to read binaries
into hex decimal to ascii.

or you could join the group
who are designing that open source
graphics project/software called
paint.net

they have a newsgroup and i am
pretty sure you will find something
through there.....
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top