A misty Dutch morning from the train.

EXIFInfo Format files for renaming using camera date:

Now we have two cameras I wanted to be able to order the JPEG images from both per day in chronological order. Hmmmm. I didn't fancy the idea of manually renaming 1.2GB of pictures from our Summer 2007 cycle tour, and started looking round for a solution. I discovered that Variations could rename files according to camera date, and then discovered a) I could not get it to work reliably or rename a whole directory b) there seemed to be a problem if two (or more) images had the same timestamp.

Back to the drawing board. I found something for the macs that did the job quite nicely. However this left me with the problem of transferring the files across the network (reliable via Omniclient but slow) and getting them back (either in one go or per image as I needed them). So it was a partial solution to the problem, but my preference was for a native RISC OS one.

For some reason I started fiddling with EXIFInfo. I figured if the program could extract the EXIF data, and format it into a CSV file, maybe it could be made to extract the data, build an obey file and rename the images in one go. After some hacking and a few emails to Chris Terran the problem was solved. EXIFInfo is far more versatile that I imagined so thanks should go to Chris for writing the application and for the support offered.

The formats, are zipped up and to be found here (you might need to filetype this to archive). These need to be unzipped and dropped into the 'Formats' folder inside EXIFInfo (Shift double click on !EXIFInfo to find the 'Formats' folder). Note this has only been tested with JPEG images from our Olympus C730 and Panasonic Lumix DMC LS2 cameras. I presume the formats should work with other cameras as the information used is generic. Feedback welcome.

The formats are as follows;
'Stan's format': P8060310/jpg is renamed to 2006_08_06_16-23-13_C730UZ_P8060310/jpg.
'ISO_8601': P8060310/jpg is renamed to 2006-08-06T162313_C730UZ_P8060310/jpg
'No model name': P8060310/jpg is renamed to 2006_08_06_16-23-13_P8060310/jpg

Renaming files.
1) If something goes wrong and (however unlikely) you lose your images, or your computer runs outside and ravishes the neighbours cat, I'm not accepting any responsibility for such problems. Use at your own risk. Having said that these format files seem to work reliably on the images I have tried them on.
2) My advice is to do this ONLY on copies of your image files. I keep the originals saved elsewhere and read only and have a working directory when I am renaming or using images.
3) Make sure you have public and unprotected access on the images you wish to rename.
4) Start up EXIFInfo (after adding the new format files) and select the format you want to use for renaming. Drag the image directory onto the EXIFInfo window.
5) If you do NOT tick 'Run on completion' then the rename file will be created inside the image directory. You can then check the contents of the obey file, if you want to be sure the rename will go OK.
If you tick 'Run on completion' the obey file will be generated and then run by EXIFInfo. Thus your files will be automatically renamed without further human intervention (unless you have ignored point 3).


1) If you end up with an empty rename file, or some files are not renamed (properly), chances are the EXIF information in the JPEG has been lost. Some (RISC OS) image processing programs do not take EXIF information into account when saving. Furthermore, if you go from JPEG to sprite and back you will also lose the extra information. This is one reason why it is advisable to keep 'read only' copies of camera images and work on copies of these images.
2) If your camera date/time was wrong when you took the pictures, then the images will be renamed to that 'wrong' date/time. A classic case of GIGO.
3) DtRnm-01 and DtRnm-02 should give unique filenames if the timestamps of two different files are identical. If you are using two identical cameras, both allocating image names in the same ranges then you could run into problems. It is then possible that you could generate images with the same names and timestamps. Not terribly likely but possible.
4) If the camera name has a spaces in it apparently the rename will fail. This can be corrected by opening the obey file with your favourite text editor (which of course will be StrongEd) and deleting the space(s). When opened you should see one rename command per line, if not increase the width of the page (in terms of characters) so that the lines are displayed without wrapping. Then highlight all lines, and then delete the space from one line. If all lines are highlighted and the lines are not wrapped you should be able to delete all spaces in one go. I presume that Zap users can also do the same, please refer to your local Zap expert as I have never used Zap in earnest.
5) Also apparently if you bury your JPEGs deep down in your hard drive the path gets too long and the rename will also fail. I haven't seen this on RISC OS 5 and indeed the rename works here in directories 8 deep on the hard drive. If you hit this problem try placing files to be renamed in a directory named with a single letter at the top level of your drive;
For example ADFS::HardDisc4.$.A


If you wish to create your own versions this is very simple. Full details can be found in the EXIFInfo reference manual (follow Quick links --> EXIFInfo program and there is a link to the manual).

If you require a different date format then this can be set in the format file by changing the !exifdateformat line. I understand that this is the standard RISC OS date format system.

You might wonder why I did not choose to use one of the 'sub second' strings in the EXIF specification to ensure a unique camera name. Well;
1) our Panasonic camera does not support these tags
2) using the original name from the camera in the new name allows originals to be located easily.
3) the original name supplies a nice /JPG extension which is handy when using images on macs or PC's. You could of course add and extension in the format file and do away with the original image name.
4) even a subsecond string cannot guarantee a unique filename.

Back to the main page.

The small print. Unless stated otherwise © 2003 to 2007 Stan Williams and D J Jongkind. If you wish to use our images or words, please check with us first before doing so.