Shifting dates and times in Fujifilm RAF files

A recent work trip brought me to a very beautiful region on this planet. This and the prospect of a few other nice trips this year led me to the decision to buy a new camera, since my Panasonic DMC-LX3 has started to show its age in terms of picture quality, compared to modern mirror-less interchangeable cameras and—believe it or not—my iPhone 4S.
I opted for a Fujifilm X-E1 with the Fujinon XF 18-55mm F2.8-4 R LM OIS lens and I got a good deal for it, seeing that the X-E2 had just hit the market.

Being still new to the camera—and admittedly not quite awake—I made a mistake when setting the date once I was in the destination timezone, resulting in the date stamps in the EXIF data being off by -2 years and -6 hours in every picture. Of course I only noticed that once I sat in my home office again, while importing gigabytes of pictures into Aperture.
This is where it started to go downhill, because while Aperture seems to do a fine job of processing the RAW file format Fujifilm uses, it doesn't have the ability to change the EXIF data of the files.

After a lot of searching, the only viable solution turned out to be a command line application called exiftool by Phil Harvey.
It allows for date and time shifting using an easy syntax — "easy" once you've stopped feeling intimidated by the prospect of using a command line application for a task like this.

The following workaround has been done on a Mac, but since exiftool works on Windows, Linux and OS X this can be applied to other setups as well. On Windows there's actually a nice GUI application called Geosetter that uses exiftool in the background, making the entire process even less intimidating.

I initially thought I had to export everything from Aperture into a folder and then let loose exiftool on the exported files like a hungry hyena, but it was much easier than that. Seeing that each Aperture library file is a glorified folder, you can right click it in the Finder and select 'Show Package Contents' from the context menu. A folder will open, showing the contents of the library.
Inside that folder the master files are kept in the folder 'masters' (Duh!), sorted into subfolders for years, months and (approximate) days and times.

Now to the actual use of exiftool for my problem:
I wanted to change all date tags inside each photo (EXIF data contains more than one date tag and I wasn't sure which one Aperture would use or if it would get confused if it found two different dates in one file). As I had set the X-E1 to capture both a RAF file and a JPG at the same time, I needed it to change the JPG date and time stamps as well.

After closing Aperture the first problem I faced when running exiftool on a few files was that it returned minor errors and warnings like this;

Warning: Non-null bytes found in padding …

and subsequently didn't process files that returned errors. I thought that there had to be some way to still process these files and a quick search for the warning turned up a forum thread and the maker of exiftool provided an answer:

"As far as I can tell, the non-null bytes in the normally-empty section of the RAF image aren't referenced from anywhere, so I'm thinking that they are just garbage data.  I'll update the next version of ExifTool to make this a minor error, allowing the file to be written with the -m option."

The '-m' option you say? A quick look into the documentation revealed this explanation:

-m (-ignoreMinorErrors) Ignore minor errors and warnings

With that in mind, here's what I did:
I opened a Terminal window and entere the command

exiftool -AllDates+='2:0:0 6:0:0' -m /Volumes/folder-path-to-my-photos

Here's what the command does:

  • exiftool launches the application.
  • -AllDates changes all dates tag within a picture.
  • += tells the app that the adjustment will advance the dates into the future ('-=' would put them into the past).
  • '2:0:0 6:0:0' changes the date by '2years:0months:0days 6hours:0minutes:0seconds'.
  • /Volumes/folder-path-to-my-photos represents the location of my photos or a single file in the Aperture library package/folder.

The cool thing about the way the Terminal works in OS X, is that you don't even have to type in the folder path manually — a source of many frustrating errors. Instead you can drag the icon next to the title of the folder from the Finder window into the Terminal window and place it behind the command (don't forget the space between '-m' and the folder path).

What resulted in the folder were .RAF and .JPG files with changed EXIF data and .RAF_original/.JPG_original files, the latter being the original files exiftool kept as a backup. I removed these files from the folder and put them in a backup location on my hard drive until I was sure that the new files not only had the right date, but were also intact.

I started Aperture again, and after a few seconds it realised that the dates had changed and started to rearrange the files. Having changed quite a lot of files, it took a couple of minutes to re-process the photos, but afterwards everything looked great and all photos had the correct date and time associated with them.

In summary this shouldn't have been necessary. Aperture—being the advanced application that it supposedly is—should be able to change date and times stamps as well as every other piece of EXIT and IPTC data I want it to change, because mistakes happen. Thankfully exiftool and similar applications exist, allowing users to make these changes and I'll be sending Phil Harvey some money because his work saved me a lot of headaches.


Here's a condensed version of the workflow I used to change the date and time stamps in the EXIF data of my photos:

  1. Close Aperture.
  2. Open the Aperture library package/folder by right-clicking it in the finder and selecting 'Show Package Contents'.
  3. Navigate to the 'masters' folder and the subfolder holding the pictures that need EXIF data adjustments.
  4. Open a Terminal window and type the following command exiftool -AllDates+='2:0:0 6:0:0' -m. Add a space behind the '-m'.
  5. Drag the folder icon left of the title of the folder in the Finder window and drop it behind the command.
  6. Hit return on the keyboard and wait for exiftool to finish processing the files.
  7. Move the .JPG_original/.RAF_original/.XYZ_original files to a backup location outside the Aperture library package/folder until the successful adjustment has been confirmed.
  8. Launch Aperture, select the project in question and give Aperture some time to re-process the photos.
  9. If the desired changes have been applied correctly and Aperture doesn't show any errors or wrong EXIF information, delete the backup files.