JPG EXIF Properties

A

adebiasio

Hello. I am trying to access the date taken property from a JPG.

I create an image object with the filename and loop through the
property items and extract the date taken property. The problem I am
having is that it takes too long to loop through all my pictures and
create an image object with each one.

Is there a way to access the EXIF - Date taken property without
creating an image or bitmap object in code?

Thanks!
 
M

mayayana

Is there a way to access the EXIF - Date taken property without
creating an image or bitmap object in code?

You can read the file directly and parse the EXIF
header. See here for details:

http://www.media.mit.edu/pia/Research/deepview/exif.html

I don't have .Net code but here's a relatively
simple VBScript class that returns EXIF data,
including embedded thumbnails, if present. (That
can be handy when you're faced with resizing a large
number of images that were taken at 10 megapixel
resolution.)

www.jsware.net/jsware/scripts.php5#jpginf

It shouldn't be hard to adapt the VBScript. The
JPG/EXIF formatting is messy and poorly designed,
but it's not overly complex.
 
J

James Hahn

The library that you have referred to loads the image in order to extract
the EXIF data. That is what OP is trying to avoid. The library is no use
to OP.
 
A

adebiasio

  You can read the file directly and parse theEXIF
header. See here for details:

http://www.media.mit.edu/pia/Research/deepview/exif.html

  I don't have .Net code but here's a relatively
simple VBScript class that returnsEXIFdata,
including embedded thumbnails, if present. (That
can be handy when you're faced with resizing a large
number of images that were taken at 10 megapixel
resolution.)

www.jsware.net/jsware/scripts.php5#jpginf

   It shouldn't be hard to adapt the VBScript. The
JPG/EXIFformatting is messy and poorly designed,
but it's not overly complex.

Thanks for the info. I converted the code in the VBScript to work in
vb.net and it works properly. I can extract the information I need.

I compared this way to to my original way with extracting the info via
an image object and this way is about 40% faster based on my tests.
Thanks!
 
M

mayayana

Thanks for the info. I converted the code in the VBScript to work in
vb.net and it works properly. I can extract the information I need.

I compared this way to to my original way with extracting the info via
an image object and this way is about 40% faster based on my tests.
Thanks!
You're welcome. I'm not familiar with the image
object. It may be very efficient. But I'm surprised
that the direct method is not more efficient. If
you're reading the whole file (into an array?) you
might find it quicker to just read part. Digital
cameras take *very* big photos these days, but
the file header should be fairly small. I usually
read up to 20,000 bytes and then provide for going
back for a second read if necessary, but I think
the 20,000 is probably enough in virtually all cases.
Even when there's an embedded thumbnail that's
usually just 3-4 KB.
 

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