Where can I save the original file name in the metadata?

I would like to write the original filename of photos to the metadata using exiftool in a field that is recognized by digiKam, not a field that is commonly used (like title, description), and is a field that can be used in a search. Any suggestions?

two examples that don’t work: OriginalFileName in XMP-Gettyimages has a nice ring, but digiKam doesn’t see it. I thought of re-purposing IPTC:Source which digiKam does see, but apparently that’s not a field that can be searched on.

The long version. Some years ago I decided to finally organize my digital photos going back to the late 90s. I compared the current photo management options and settled on gthumb, a decision I would eventually come to regret. It no longer meets my needs so I am finally biting the bullet and migrating everything to digiKam. In the process I want to rename the images to something more descriptive than IMG_0097. The problem is there are past materials that refer to images using the original names, and I want some way to easily find them among the new names. Of course there are likely multiple IMG_0097 images, but I could easily find the original among a handful. So, I thought if I could add the original file name to the digiKam database I could quickly find the original file. A lot of googling hasn’t found a simple solution. I suppose I could just keep all the old photos with their current names, and use a new naming system going forward, but I keep thinking I’ll find in the future that again I made a bad decision.

digiKam supports tags and keywords. I find those to be much more search friendly than looking for hte file name. Have you thought about using those?

I leave the file names alone!

What Mica proposed is certainly a good option. If you still want to use descriptive filenames (I do it too in case I need to access files without digikam at hand), maybe IPTC:Title is a good candidate. It is searchable through the advanced search.

Thanks for the suggestion. There are a few problems with using IPTC:Title

In my searching I had read that one use for IPTC:Title was to store original photo filenames, so I tried writing it with exiftool and got ‘tag does not exist’, and kind of gave up. Now I’ve been reading more and found Title is an alternative name for Object Name. Tried that with exiftool and it works.

Looks promising. Until I get to digiKam.

If you use Tools / Edit Metadata you can write IPTC:Title (called Object Name in the metadata viewer, and in the file itself). If you want to do a quit update and use the Captions tab on the right panel to give your photo a nice Title this writes to XMP-dc:Title but it also overwrites anything in IPTC:Title (Object Name).

Ok, so, if I only add my Title from the Edit Metadata I’ll be ok?

No. While the advanced search prompt says digiKam is searching the IPTC title, it is actually just searching XMP-dc:Title. I guess digiKam assumes that they are the same.

Maybe Mica is right.

sudo apt-get install libimage-exiftool-perl

ImageDescription is a free-to-use user tag no, for what ever you want?

write anything you want into ImageDescription, in this case the file name, as an example

for file in *jpg
do
   base=`echo $file | sed 's/.jpg//'`
   exiftool -a ImageDescription=$base $file; 
done

Now check your work:

for file in *jpg; 
do 
   exiftool ImageDescription $file; 
done

The first for-loop could be written more generally, perhaps with egrep, so it worked with other image types besides jpg

Thank you for the suggestion. I’m using a ‘find do’ loop for manipulation but it’s a similar idea.

exiftool writes ImageDescription to IFD0:ImageDescription.

Using the digiKam right panel Captions tab to enter a caption will show the existing contents of XMP-dc:Description if it exists, which it does if I’ve added any comments or descriptions to my photos previously. If not, digikam does appear to pick up the caption from IFD0:ImageDescription. Entering a caption on that screen will update XMP-dc:Description, and then create or overwrite the following

  • IFD0:ImageDescription
  • ExifIFD:UserComment
  • XMP-tiff:ImageDescription
  • XMP-acdsee:Notes
  • XMP-exif:UserComment
  • IPTC:-Caption-Abstract

What happens when you try to change any of the Caption or Description fields using the Edit Metadata dialog is confusing and I haven’t tried to figure it out.

The Advanced Search only searches the XMP-dc:Description tag, none of the others

To extrapolate original file names, I would sort the RAWs or TIFs according to the DateTimeOriginal tag. That way you would know where in the timeline they were taken.