Welcome to DigiForumz.com!
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

API To Get To EXIF Data?

 
   Digital Camera Community (Home) -> General Discussions RSS
Next:  Invitation  
Author Message
user

External


Since: Nov 09, 2005
Posts: 123



(Msg. 1) Posted: Mon Jan 01, 2007 12:12 pm
Post subject: API To Get To EXIF Data?
Archived from groups: rec>photo>digital (more info?)

I have about 10,000 pix that I'd like to rename so that each file name begins
with the date. e.g. "2003 09-27 Joe Birthday".

Problem is that some of them are already named using that convention.

So I'd like to write a little VB program to iterate through all the pix, look at
the file name, and - if it doesn't begin with a date - go into the EXIF data,
retrieve the date, and rename the file accordingly.

I'm assuming that the various utilities that are undoubtedly available will not
let me check the file name before doing anything.

Anybody know of an API that will let me get to a pic's EXIF info?


--
PeteCresswell

 >> Stay informed about: API To Get To EXIF Data? 
Back to top
Login to vote
Richard H.

External


Since: Sep 10, 2006
Posts: 107



(Msg. 2) Posted: Mon Jan 01, 2007 12:12 pm
Post subject: Re: API To Get To EXIF Data? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

(PeteCresswell) wrote:
> Anybody know of an API that will let me get to a pic's EXIF info?

You can do it with Perl using ExifTool:
http://owl.phy.queensu.ca/~phil/exiftool/

There's a command-line interface that can do this by rebuilding the name
from scratch (not deriving it from the current name), or you can modify
it to re-use parts of the existing name.

There's also a new Windows version. I haven't used it, but I'd
speculate it won't be flexible enough for this application.

Cheers,
Richard

 >> Stay informed about: API To Get To EXIF Data? 
Back to top
Login to vote
Ken Lucke

External


Since: Sep 24, 2006
Posts: 432



(Msg. 3) Posted: Mon Jan 01, 2007 12:12 pm
Post subject: Re: API To Get To EXIF Data? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

In article <dvfip2pmjnktn5psovhc0o6qb1bpn90ogj.RemoveThis@4ax.com>, PeteCresswell
<x.RemoveThis@y.Invalid> wrote:

> I have about 10,000 pix that I'd like to rename so that each file name begins
> with the date. e.g. "2003 09-27 Joe Birthday".
>
> Problem is that some of them are already named using that convention.
>
> So I'd like to write a little VB program to iterate through all the pix, look
> at
> the file name, and - if it doesn't begin with a date - go into the EXIF data,
> retrieve the date, and rename the file accordingly.
>
> I'm assuming that the various utilities that are undoubtedly available will
> not
> let me check the file name before doing anything.
>
> Anybody know of an API that will let me get to a pic's EXIF info?

ExifTool. <http://www.sno.phy.queensu.ca/~phil/exiftool/>

But your concern about extra work to go to if files are already named
in that convention is probably needless - if you tell it to rename a
file that's already named what you are attempting to change it to, it
will either a) rename it anyway, effectively leaving it the same, or b)
dump an error code at you which you can then ignore (depends on what
programming language or utility you are using). Either way, you don't
have to worry about it.

--
You need only reflect that one of the best ways to get yourself a
reputation as a dangerous citizen these days is to go about repeating
the very phrases which our founding fathers used in the struggle for
independence.
-- Charles A. Beard
 >> Stay informed about: API To Get To EXIF Data? 
Back to top
Login to vote
Cynicor

External


Since: Dec 07, 2006
Posts: 185



(Msg. 4) Posted: Mon Jan 01, 2007 12:34 pm
Post subject: Re: API To Get To EXIF Data? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

(PeteCresswell) wrote:
> I have about 10,000 pix that I'd like to rename so that each file name begins
> with the date. e.g. "2003 09-27 Joe Birthday".
>
> Problem is that some of them are already named using that convention.
>
> So I'd like to write a little VB program to iterate through all the pix, look at
> the file name, and - if it doesn't begin with a date - go into the EXIF data,
> retrieve the date, and rename the file accordingly.
>
> I'm assuming that the various utilities that are undoubtedly available will not
> let me check the file name before doing anything.
>
> Anybody know of an API that will let me get to a pic's EXIF info?

You can use VB.NET to do it. Basically, you can say:

objImage = System.Drawing.Image.FromFile(FileName)

then

Dim i As PropertyItem
For Each i In objImage.PropertyItems

or something similar. An i.Id value of &H9003 is the original date/time.
Then you can convert that to the string you want, and rename the file
with the My.Computer.FileSystem APIs or your favorite file renaming code.

I'm working on a project now (for an upcoming magazine article) and can
send you some source code if you're interested. Drop me a line at my
email address (with the dots taken out).
 >> Stay informed about: API To Get To EXIF Data? 
Back to top
Login to vote
Matt Ion

External


Since: Oct 09, 2006
Posts: 333



(Msg. 5) Posted: Mon Jan 01, 2007 5:56 pm
Post subject: Re: API To Get To EXIF Data? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

(PeteCresswell) wrote:
> I have about 10,000 pix that I'd like to rename so that each file name begins
> with the date. e.g. "2003 09-27 Joe Birthday".
>
> Problem is that some of them are already named using that convention.
>
> So I'd like to write a little VB program to iterate through all the pix, look at
> the file name, and - if it doesn't begin with a date - go into the EXIF data,
> retrieve the date, and rename the file accordingly.
>
> I'm assuming that the various utilities that are undoubtedly available will not
> let me check the file name before doing anything.
>
> Anybody know of an API that will let me get to a pic's EXIF info?

IrfanView will do the renaming in batch mode. Just set a rename pattern of
"$E36868(%Y %m-%d) $N" (the $N retains the original filename, with extension).
Mind you, that won't skip files that are already named properly, so you'll end
up with a double-datestamp in them.
 >> Stay informed about: API To Get To EXIF Data? 
Back to top
Login to vote
Dave Cohen

External


Since: Jul 27, 2006
Posts: 456



(Msg. 6) Posted: Mon Jan 01, 2007 5:56 pm
Post subject: Re: API To Get To EXIF Data? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

(PeteCresswell) wrote:
> I have about 10,000 pix that I'd like to rename so that each file name begins
> with the date. e.g. "2003 09-27 Joe Birthday".
>
> Problem is that some of them are already named using that convention.
>
> So I'd like to write a little VB program to iterate through all the pix, look at
> the file name, and - if it doesn't begin with a date - go into the EXIF data,
> retrieve the date, and rename the file accordingly.
>
> I'm assuming that the various utilities that are undoubtedly available will not
> let me check the file name before doing anything.
>
> Anybody know of an API that will let me get to a pic's EXIF info?
>
>

Use a free download renamemaster. You can simply replace the existing
name with what you want. You may need to look at the help file for an
example of exif data extraction. That's not so good, while the text
(it's a web page) is readable, the example screen shots require
microscopic eyesight and a good imagination. Still, I figured it out so
I'm sure you'll have no problem.
Dave Cohen
 >> Stay informed about: API To Get To EXIF Data? 
Back to top
Login to vote
Arnor Baldvinsson

External


Since: Dec 08, 2006
Posts: 36



(Msg. 7) Posted: Mon Jan 01, 2007 7:56 pm
Post subject: Re: API To Get To EXIF Data? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Hi Pete,

> Anybody know of an API that will let me get to a pic's EXIF info?

Check out the FreeImage library. Freeimage.org I think it is. You can
retrieve exif with it.

Best regards,

--
Arnor Baldvinsson
San Antonio, Texas
 >> Stay informed about: API To Get To EXIF Data? 
Back to top
Login to vote
Bruce Lewis

External


Since: Nov 07, 2005
Posts: 68



(Msg. 8) Posted: Tue Jan 02, 2007 12:18 pm
Post subject: Re: API To Get To EXIF Data? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

"(PeteCresswell)" <x DeleteThis @y.Invalid> writes:

> I have about 10,000 pix that I'd like to rename so that each file name begins
> with the date. e.g. "2003 09-27 Joe Birthday".
>
> Problem is that some of them are already named using that convention.

The ones that aren't named using that convention -- do they all start
with a letter? If so, you can likely come up with a Unix command to do
it, something along these lines:

jhead -fsomething `find . -name '[a-zA-Z]*.jpg' -print`

--

http://ourdoings.com/ Easily organize and disseminate news and
photos for your family or group.
 >> Stay informed about: API To Get To EXIF Data? 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
Saving Photo Without EXIF Data - What's the best way to save a photo in JPEG format so that the EXIF date isn't present?

Where the Heck Do You Find Exif Data? - I have my photos downloaded to a ThinkPad laptop running Windows XP. The photos are downloaded with Microsoft Camera Wizard to My Pictures. The only available data is the byte size of the particular photo/file. Anyway, I thought I'd post here before..

EXIF data. Exporting & formatting. - I want to put EXIF data in a white strip along the bottom of photos, pref in Phohoshop. Can anyone advise the best way to do this? I want a selection of EXIF data only and I need to have a suitable font and font size. Please help, Frank

What's an easy way to enter EXIF data? - I have a OlympusE500 SLR digital which records EXIF data automatically. But I need to add extra such as "comments" and "author". Is there good software to handle this? I am thinking of something like an EXIF pop-up window in fr...

Backing up Exif data from PEF (Exiftool question) - After processing my RAW Pentax *ist DS PEF files with Photoshop Elements 3, most of the Exif information stored in the RAW image is gone much to my chagrin. I have been looking at the ExifTools Perl script and that allows me to copy most of the Exif data...
   Digital Camera Community (Home) -> General Discussions All times are: Pacific Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]