Google Answers Logo
View Question
Q: Put the title of picture in EXIF 'date taken'-field ( Answered,   1 Comment )
Subject: Put the title of picture in EXIF 'date taken'-field
Category: Computers > Software
Asked by: lrat-ga
List Price: $25.00
Posted: 18 Sep 2005 04:44 PDT
Expires: 18 Oct 2005 04:44 PDT
Question ID: 569341
Change EXIF date taken. Hello, I have 5000 pictures named as
2003-06-12 or as 1981-06-30 001 or as  1999-01-18 17-35-11 . This
makes it easy to catalogue them.
Now I want to use a time-line in my FotoTime and Picasa2 software. It
cannot do this as there is no EXIF data.
I am looking for software that takes the information out of the
picture name and puts it in the EXIF 'date taken'-field.
Eg. when the title of a picture is 2004-05-13 12-11-44 then I want to
see this information in the date taken field of the EXIF.
All my pictures are JPEG, or TIFF.
Many thanks in advance.

Request for Question Clarification by maniac-ga on 18 Sep 2005 12:35 PDT
Hello Lrat,

I would normally suggest "exiftime", described at
part of a larger package at
which I could script quite easily on a Linux or Unix system to do what
you ask. However, you do not indicate the operating system (Windows?)
which would complicate the solution.

Please indicate the operating system and if Windows, if you would be
willing to download Cygwin
to do this task.


Clarification of Question by lrat-ga on 19 Sep 2005 04:18 PDT
Hello Maniac,
Thanks for your quick response. I am running Windows XP Proffessional with SP1.
I am prepared to download Cygwin if that is required.
To clarify a couple of things;
Following formats are used:
1931-00-00           If I didn't know the exact date taken (Month and day).
1938-06-00           If I didn't know the exact date taken (Day)
1946-06-01 002       If there are more then one pictures on the same date
2003-04-10 21-32-10  Are pictures taken by digital camera but no EXIF exist.
I have pictures dating back till 1870. These are all scanned in and 
obviously there's no EXIF available.
I have JPEG and TIFF pictures. Do I need to convert the TIFF pictures
into JPEG? What do you recommend and what kind of software do I need
to use for that.
I appreciate your help in this matter very much and if you can supply
a good working code then the money is yours.
Best regards


Request for Question Clarification by maniac-ga on 19 Sep 2005 19:17 PDT
Hello Lrat,

Very odd - when attempting to access to get the files I am
getting referred to an invalid IP address ( Change the path
to include www. to read
I also noticed this program is not suitable because it cannot add the
time, only modify an existing EXIF time. We need something else.

EXIF by the way works on both JPEG and TIFF format files - the file
type should not be a problem. See
for details (this is the specification of EXIF - search for DateTime
to see the format of the date / time field (PDF page 30).

Since you are on Windows, let me do a little more research on Windows
applications that may do the job and get back to you. In the meantime,
I found a few choices such as
or a free download at

See also a message on on adding the EXIF data to scanned images

Will follow up after some testing to see what works and doesn't.

Request for Question Clarification by maniac-ga on 21 Sep 2005 16:33 PDT
Hello Lrat,

This has turned out to be much more difficult than I expected. I tried
the three Windows applications and two are completely unsuitable and I
don't see a clear way to automate use of the third.

I also checked out Jhead, but it has a similar problem that exiftime
does - it cannot create a new EXIF header from scratch and can set
dates only if the date field is present.

Still looking but there may not be an easy solution.


Clarification of Question by lrat-ga on 22 Sep 2005 03:17 PDT
Hello Maniac,

I appreciate your help very much. I have been searching the net myself
since a long time to find a solution for this problem, but so far no
plausible solution.
That's why I posted this question. To me it seems like I need a small
program that  does the job. Unfortunately, I don't know how to do
this. I have basic understanding of C, but I am not an expert.
If you could come up with a plausible solution I will be extremely
happy, but if it's too much of a hassle then no need to push. I am
sure a soulution will appear somehow in the near future.
Best regards,

Subject: Re: Put the title of picture in EXIF 'date taken'-field
Answered By: maniac-ga on 23 Sep 2005 14:52 PDT
Hello Lrat,

OK. It appears there IS a tool out there that can be automated and do
what you ask. The tool that does the heavy lifting is called
which can be downloaded from this site.
This file is compressed in "tar format", get a copy of WinZip
or a similar unpacking program to open it up. I will also mention how
to do it using Cygwin later in the answer as well. There is pretty
complete documentation in the html directory after the file is

For my testing, I used Cygwin to get the necessary utility programs
and to script the bulk processing of files. The steps I followed were
as follows:

[1] Download the Cygwin setup program
(the download link is near the middle of the page)

[2] Run setup.exe. The first time, I suggest just taking the defaults
which will download some programs and help make sure you get
reasonable performance from the server you selected. I looked at
to find a site relatively close to my system.
(I chose the one at, but others may be closer to your system /
have better performance for your situation).

[3] Make sure the basic install works. Select the desktop icon (if
installed) or the start menu selection. You should get a command line
window. Try some simple commands like
  ls   [which lists the files in the "current directory"]
  ls /bin  [which lists a set of executable programs]
  pwd  [which prints the name of the "current directory" with path]
  man man  [which describes an online manual system]
  man bash [which will describe more than you want about the "shell" commands]

[4] Download / install the other applications needed. Run setup.exe
again and when given the list of packages, select Full and scroll the
list to find perl. If it is not shown to be installed, click on it and then
start the download / install. It should take a few minutes to
download with a cable modem or DSL (certainly longer with dial up).

[5] Locate your copy of exiftools. I suggest you put it into an
otherwise empty directory for testing. The directory on my system was
on the "D" drive and I used
  cd /cygdrive/d/Maniac/google/
to go into the directory referred to D:\Maniac\google\ by Windows.
Modify that command line to go into the directory you have. If there
are spaces in the path, be sure to use quotes ("" or '') around the

[6] Copy a few picture files into that same directory. I used the
names you previously identified for testing, so I had four files (as
shown by ls *.JPG).
  1946-06-01 002.JPG
  2003-04-10 21-32-10.JPG

[7] Copy the shell script files listed at the end of the answer into
files in the same directory. I suggest copy / paste into notepad but
any other way to create a text file with the right file name is OK.
They need to be made "executable" so use the following command to do
  cd /cygdrive/d/Maniac/google/      [if not already in that directory]
  chmod +x
in a cygwin command line window.

[8] At this point, you should be able to run a simple test
  ./ *.JPG
which should print out lines like the following:
Date/Time Of Digitization       : 2005:08:21 15:30:04
    1 image files updated
Date/Time Of Digitization       : 1931:00:00 00:00:00
Date/Time Of Digitization       : 2005:08:21 15:30:32
    1 image files updated
Date/Time Of Digitization       : 1938:06:00 00:00:00
Date/Time Of Digitization       : 2005:08:21 15:31:17
    1 image files updated
Date/Time Of Digitization       : 1946:06:01 00:00:02
Date/Time Of Digitization       : 2005:08:21 15:32:09
    1 image files updated
Date/Time Of Digitization       : 2003:04:10 21:32:10

At this point, the basic operation of setting the EXIF date (in this
case, CreateDate) should be ready to use on your files.

There are a few changes I suggest you make to make this easier to use.
Edit the script files with notepad or another suitable program.

#1. Modify so it has the correct location of In the
copy I am providing, it assumes that is in the same
directory as the pictures. In general that is not true, so change the
line reading:
  ND=`./ "$ADATE"`
to something like
  ND=`/cygdrive/d/Maniac/google/ "$ADATE"`
(the proper location should be specified)
The same change should be made for the location of exiftool so change
  ~/Downloads/Image-ExifTool-5.63/exiftool -CreateDate="$ND" "$N"
(this was a subdirectory to my "downloads" directory)
to read
  /cygdrive/d/Maniac/google/exiftool -CreateDate="$ND" "$N"
(the proper location should be specified)

#2. Remove the extra output of the script. Add a # for the first
and last reference to running exiftool. For example, it could read:

#    ~/Downloads/Image-ExifTool-5.63/exiftool -CreateDate "$N"
    ~/Downloads/Image-ExifTool-5.63/exiftool -CreateDate="$ND" "$N"
#    ~/Downloads/Image-ExifTool-5.63/exiftool -CreateDate "$N"
so the script will not produce ANY output (other than errors).

#3. Handle more than the two file types I provided in I assumed
the JPG file type for your JPEG files and TIF file type for your TIFF
files. If you don't use those file types add lines like these to the
to handle files with file type TIFF.

#4. Add -overwrite_original to the command line that sets the
CreateDate. This of course is considered "dangerous" by the author of
exiftool, but eliminates the _original files created by exiftool. What
I suggest instead is to do
  rm *_original
after running the script / verifying the data is added properly.

#5. Adding other parameters to be set in the command line. See the
list of EXIF tags referred to in the documentation of exiftool for a
list of possible choices. If the line gets too long for easy reading
it can be split by adding a \ before the end of line (like below)...
    ~/Downloads/Image-ExifTool-5.63/exiftool \
      -CreateDate="$ND" "$N"

Another note - if you are in the directory with the pictures (and not
where the scripts are), start the script as follows:
   /cygdrive/D/Maniac/google/ *.JPG
(use the appropriate path...)
and if the fix for #1 was applied, it should work just fine.

Please make a clarification request if any part of the answer is
unclear or incomplete. I would be glad to help so you get all your
pictures properly marked.


--- follows ---


if (( ${#1} > 18 )) ; then
elif (( ${#1} > 11 )) ; then
printf "%4s:%2s:%2s %2s:%2s:%2s\n" $YEAR $MONTH $DAY $HOUR $MINUTE $SECOND

--- follows ---

# Created by Maniac on 23 September 2005
# Process a set of files, adjusting dates and adding
# those dates to the EXIF information in the picture

for N in "$@" ; do
#    echo $N
    ND=`./ "$ADATE"`
#    printf "%s\n" "$ND"
    ~/Downloads/Image-ExifTool-5.63/exiftool -CreateDate "$N"
    ~/Downloads/Image-ExifTool-5.63/exiftool -CreateDate="$ND" "$N"
    ~/Downloads/Image-ExifTool-5.63/exiftool -CreateDate "$N"

Request for Answer Clarification by lrat-ga on 28 Sep 2005 03:51 PDT
Hello Maniac,
I spent some serious time to work out your answer and at this stage
I'm getting more and more confused.This is what I have done:
Downloaded and installed Winzip
Downloaded and installed Cygwin and the test commands you gave me do
work. The DOS screen opens up and it functions.
I clicked on the link to download Exiftool 5.63 and it downloads,
opens up with Winzip but I cannot find an executable to install the
program. There are so many options and I don't know what I'm looking
I downloaded Perl as well but cannot install it on my computer. It
doesn't open up with Winzip. Do I have to install Perl to have things
working? Which version do I need to use?
I cannot locate my copy of Exiftools as it has not been installed and
that's where I come to a standstill.
I hope you can give me some simple directions to install Exiftools.
Thanks a lot for your help.

Clarification of Answer by maniac-ga on 29 Sep 2005 10:23 PDT
Hello Lrat,

> This is what I have done:
> Downloaded and installed Winzip

> Downloaded and installed Cygwin and the test commands you gave me
> do work. The DOS screen opens up and it functions.
I assume it is NOT a DOS screen (just looks like one). The title in
the window should read "Cygwin Bash Shell" and then change to
something like "~" (or whatever directory you are currently working

> I clicked on the link to download Exiftool 5.63 and it
> downloads, opens up with Winzip but I cannot find an
> executable to install the program. There are so many options
> and I don't know what I'm looking for.
There is no "executable" to install. You use Winzip only to extract
the files into a folder of your choosing. After extracting the files
on my system I had the following listed in the folder
(D:\maniac\google on my system):
 sub directories - html, lib, t
 Changes  (a text file describing changes to exiftool
 exiftool (a perl script that does the file updates)
 README (a text file explaining exiftool including an test you can run)
 MANIFEST (a text file listing all the files provided)
and several other files.

I did not do ANYTHING on my system to this folder other than adding
some images for testing purposes. You do need to know where this
folder is located (for the command lines in later steps).

> I downloaded Perl as well but cannot install it on my computer.
The instructions I provided in step [4] said to run setup.exe again
from Cygwin to download and install Perl. Let me walk through the
steps briefly:
 - run setup.exe (the one provided with Cygwin)
 - Click Next
 - confirm Install from Internet is selected, click Next
 - the root install & local package directories should already be
properly be set - click Next twice.
 - I used use IE5 settings to set up the internet connection (this
should already be properly set), click Next
 - the mirror list will appear again and the last one used should be
selected, click Next [at this point I got a couple pop up messages
about my version of Setup being old & I should update, I just hit OK
for both of these]
 - in the Category list (says Category next to the View button in the
upper right), I scrolled / clicked on Interpreters. Scroll down to
Perl. On my system Perl is already shown as installed. If not, click
the box / then Next.
 - the progress box appears / gives you status on the downloads and
install. [on my system, this took a few minutes - I have lots of "out
of date" packages]
 - then click Finish on the last window.

At this point, perl should be installed properly. In the "Cygwin Bash
Shell" window (start again if needed), entering
  perl --version
should get you something like the following as a response.
This is perl, v5.8.7 built for cygwin-thread-multi-64int

Copyright 1987-2005, Larry Wall

Perl may be copied only under the terms of either the Artistic License or the
GNU General Public License, which may be found in the Perl 5 source kit.

Complete documentation for Perl, including FAQ lists, should be found on
this system using `man perl' or `perldoc perl'.  If you have access to the
Internet, point your browser at, the Perl Home Page.

If you don't get this message, let me know.

> I cannot locate my copy of Exiftools as it has not been installed
> and that's where I come to a standstill.

See above - it is the folder in which the files are extracted. Note
the slightly different format between the path in Cygwin and in

Let me know if you still have problems - I am glad to help.

Request for Answer Clarification by lrat-ga on 09 Oct 2005 05:43 PDT
Hello Maniac,
You won't believe how many time I've already spent on this
application. I have the feeling it's going to work in the end, but at
this stage no success.
Ok, This is what I have done:
I made a directory on my D-drive (second HDD):
D/Maniac/Google/Image-Exiftool-5.63/     (Exactly the same as on your
I have all the files in this folder: html, lib, t, changes, exiftool,
I have tried to add my picture copies to the Image-Exiftool-5.63
folder and/or the Google folder. But when I run the command ./
*.JPG in Cygwin then I receive a message in the order like:
$ ./ *.JPG
./ line 14 Home/Luc/Downloads/Image-ExifTool-5.63/exiftool: No
such file or directory
./ line 15 Home/Luc/Downloads/Image-ExifTool-5.63/exiftool: No
such file or directory
./ line 16 Home/Luc/Downloads/Image-ExifTool-5.63/exiftool: No
such file or directory

So, I started to adjust the script a bit; such as
As I thought the folders are not in Luc/Downloads but on my D: drive
I tried without the D, I tried lower case, I short, I tried endless
adjustmenst but no succes.
I created the same files as on your system to make sure there is
nothing that can go wrong.
So, my questions are:
What I'm I doing wrong?
Do I keep the pictures in D/Maniac/Google or in 
Are lines 14, 15 and 16 in multifunctional or do they point to a certain path?
Is Cygwin case sensitive?
I sincerely hope you will be able to help me.
Many thanks in advance.


Clarification of Answer by maniac-ga on 11 Oct 2005 10:08 PDT
Hello Lrat,

You say that the location of exiftools is in
based on the messages you reported, the script is expecting the
file to be in a different location. The line you indicated is "almost"
(to fix lines 14, 15, and 16)

Based on what you indicated, line 15 should read:
  /cygdrive/D/Maniac/Google/Image-Exiftool-5.63/exiftool -CreateDate="$ND" "$N"
[this should appear on a single line in the script]
I mentioned this type of correction in the section starting with #1 in
the answer (and revised the location above based on where say the file
is stored).

To answer the other questions raised:

Q: What am I doing wrong?
A: The reference to exiftool was "almost" correct, see above for the
fix. If you have further problems, do not hesitate to ask "sooner"
than "later".

Q: Do I keep the pictures in D/Maniac/Google or in 
A: It is easier to put a copy of both and in the
folder with your pictures but not a requirement. Let me explain how
scripts and programs refer to files in Cygwin briefly.

If you specify a location with a starting /, that means the reference
is "absolute" - starting at the "root" (or top level) directory. The
"root directory" for Cygwin is wherever you installed it on your
Windows system. I installed Cygwin on my machine at
so references to /usr/bin would map to
in Windows on my system. If you installed Cygwin somewhere else,
adjust the references appropriately.

Since Windows does not have a single "root directory", Cygwin makes
you specify the drives with a prefix "/cygdrive/"; for example use
for drive "D". In that way, the example above:
refers to the Windows file

When you specify a location without a leading "/", that is a position
"relative" to the current directory (and not relative to the program /
script making the reference). Let's say you store your pictures in
and do the following steps in the Cygwin bash shell (the lines
starting with $ are the ones you type at the prompt):
  $ cd /cygdrive/D/Pictures
  $ pwd
  $ ls
  (big list of files shown)
  $ ../Maniac/Google/Image-Exiftool-5.63/ *.jpg
  (which would run referring to each of the .jpg files in the Pictures folder)
The line referring to is a short hand for
  /cygdrive/D/Maniac/Google/Image-Exiftool-5.63/ *.jpg
by going "up" a directory and then down to where the file is. The
short hand of
refers to in the current directory. This is done because the
shell has a list (called PATH) of directories to search for executable
programs. The current directory is not necessarily in that PATH.

So, to answer the "where should I keep the pictures" question - you
can put them wherever you want to as long as:
 - correctly refers to where exiftool and fixdate are located (I
suggest you make both of these absolute references)
 - when you "cd" to the folder with the pictures and run, use the
proper (absolute or relative) reference to
It is certainly easier to refer to when it is located in the same
folder as the pictures, but that is NOT a requirement.

Q: Are lines 14, 15 and 16 in multifunctional or do they point to
a certain path?
A: Lines 14 and 16 are used ONLY to print the date before / after the
file is processed in line 15 [the date SHOULD change...]. I used them
to help debug the script. I suggest you comment them out (add # to the
start of the line) as described in #2 in the answer once the script
works the way you want it.

Q: Is Cygwin case sensitive?
A: Yes and No. A Unix system is normally case sensitive, but Windows
is not. You can see this with the following commands:
  $ cd /cygdrive/D/Maniac
  $ pwd
  $ cd /cygdrive/D/maniac
  $ pwd
So Cygwin remembers the case used in referring to files and folders
[just like a Unix system], but the case is ignored when passed to
Windows for file / folder references.

Subject: Re: Put the title of picture in EXIF 'date taken'-field
From: rockabillyroger-ga on 24 Feb 2006 17:42 PST
I found EXITutils.  Here is a batch file that will place the filename
and the date-time when pic was taken in a text file (a comma delimeted

Type the following into notepad and save it with a .bat extension.

You have to first change to the folder (or directory) in your program
where your pics are stored.
NOTE:  you must change the [exifutils path] to the folder where
exifutils were installed.
Example: "C:\program files\exif_U\exiflist /o l /f
file-name,date-taken . > C:\PicDates.txt (all on one line)
@echo off
[exifutils path]\exiflist /o l /f file-name,date-taken . > C:\PicDates.txt

The character that comes after 'o' is a lower case L and o is not a
zero.  It is a lower case Oh.

'exif_U' is the folder name I wanted the files installed to.  Your's
may be different.

The period in the filename, right before the > character is a DOS
shortcut.  It's a stand in for the current directory.

The > C:\PicDate.txt is where the normal output to the screen is
redirected to a text file.  I placed the file in the root of drive C:
because every computer has one.  I don't have to do a lot of checking

From within a VB program you can run the Shell command.  It's a good
Idea to run a program that runs in a DOS window minimized.  If you're
running Win 98 (still using Win 98 myself), sometimes the DOS window
won't close.  So far I haven't had that problem with this particular
bat program. You must wait for the program to finish before accessing
C:\PicDate.txt.  Folders with a lot of files will take longer.

Sometimes I program with Winbatch.  It has a function called
'RunIconWait'.  It will run the bat program and execution will not
proceed to the next line until the program finishes.  I store my pics
in a folder called MyPics.  Under that are is a folder for each year. 
Under the year folder are folders for each month in the year.  I like
to store my pics chronologicly.  Here's how my program works.  I have
a Fugi Finepix S602Z camera.  I hook my camera to the computer via a
usb cable.  I turn on the camera and then I click a link that runs my
camera download program.  The pics are copied to a folder called
"!NewPics" under MyPics.  After they are downloaded (copied not moved)
out of the camera's memory card a message is displayed to turn the
camera off.  Then the program changes to the new pics folder.  The
above batchfile is run.  When the batchfile finishes I use the data in
PicDate.txt to rename the file by year, mo, day, hour(24), min, sec. 
I rename each pic file and it looks like this "2006_0201_170530.jpg"
.     yyyy mmdd hhmmss
Then the files are moved to their respective folders.  If there are no
folders then new folders are created.  I go to the folders just to
make sure the program has worked and it has placed all my pics.  When
I'm sure that it has, I use the camera to clear the memory card.  I
suppose after I have run it a while and feel sure it works like I
intended then I'll give the user a choice wheather to copy the files
or move them (which would clear the camera). If you're wanting a copy
of my program I'll give it to you free.  You first have to have
Winbatch installed because I can't afford the compiler program.  It's
$400.  It's a free download from  Plus you'll have to
wait a few weeks because I just changed my program to use EXIFutils
and I want to make sure I don't have any bugs.  One thing about
exiflist.  Until you pay for it, you can only access 10 files at a
time.  This means that you will have to run the program more then
once.  If you are a winbatch fan then send your email to:  You need to open the program and set the
location of your picture folder and your camera folder.  You can use
winbatch editor.  Look for the orange variables and set them to your
system.  You only have to do it once.  Here's the way it looks if I
were to send it to you:

NOTE:  Do not add the drive letter!
If your main picture folder is different then mine then change it to your path
If your camera's memory card has folders on it then set the second
variable to your camer'a picture folder.

Dale Owens

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  

Google Home - Answers FAQ - Terms of Service - Privacy Policy