Reading IMAGE from SQL Server database

  • Thread starter Marc Scheuner [MVP ADSI]
  • Start date
M

Marc Scheuner [MVP ADSI]

Folks,

I'd like to be able to read and display graphics stored inside an
IMAGE field in SQL Server.

How to read that stream of bytes is not the problem - but how can I
determine what kind of image I'm dealing with?? Is there some kind of
a "signature" or "magic byte mark" at the beginning to the data stream
to tell me if it's a GIF, a BMP, a JPG, or a PNG (or whatever else it
might have been) ? Since I don't have any file extensions or any other
information, I can only rely on the actual data stream itself....

Any thoughts, ideas, hints?? Thanks!!
Marc

================================================================
Marc Scheuner May The Source Be With You!
Bern, Switzerland m.scheuner(at)inova.ch
 
W

www.eztree-msdn.com \( Laurent Jordi \)

Hi

Why don't you store only path to the Image ? If you use an image field, your
database will grow very fast and your performances will decrease... Don't
you think so ?

Regards

LJ

www.eztree-msdn.com
 
C

Cor

Hi Marc,

Is this the way to go, should you not just store the format as a field in
your database. The route you are now taking means that every new format
should change your program and maybe makes things impossible if the
signature is equal. (And it needs only one field from 4 bytes in my
opinion).

Just a thought,

Cor
 

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