Sunday, January 22, 2017

Batch Set Image Metadata (Title, Description) To/From Filename

This is a guide on how to bulk change multiple images and set automatically set their metadata "title" and "description" fields to match the filename. For example, if you have a JPG file that has the filename "Family Vacation Group Picture.jpg", after this batch procedure, the image metadata field "title" would contain "Family Vacation Group Picture".

I'm posting this because I was having trouble finding guides on how to do this when Googling them myself. After an hour of searching, there was only one tool that I could find that could read from the filename and put it in the metadata - ExifTool. Every other program out there seems to allow reading from the metadata and using it to rename the file (setting the filename), but that is the opposite of what I was looking for!

Here is how to automatically fill image metadata from filenames. The command used here will set both Description and Title metadata based on filename, without the extension:

I wanted a GUI to do this, so I could visually select files and check metadata. The way to do this on Windows is with ExifTool + ExifToolGUI

  1. Download ExifTool GUI and ExifTool exe and follow directions to place files in same directory
  2. Run ExifTool GUI and navigate inside the program to the files you want to set the metadata for
  3. Click the "ExifTool Direct" button - this allows you input commands for ExifTool that get executed on the files in the selected directory
  4. Copy and paste the following command. You can then either press enter to execute, or, as I did, also save it as a preset so that you can easily execute it again in the future.
    • *.jpg *.jpeg "-Description<${filename;s/\..*?$//}" "-Title<${filename;s/\..*?$//}"

    ExifToolGui - Command to Set Metadata Based on Filename

If you are comfortable with ExifTool without a GUI:


  • I haven't tried this, but the command should be the same as above, but should call exiftool first, like this:
    exiftool *.jpg *.jpeg "-Description<${filename;s/\..*?$//}" "-Title<${filename;s/\..*?$//}"

3 comments:

  1. THANK YOU SO MUCH!! I spent so much time trying to figure this out. You helped me SO MUCH! Your method works PERFECTLY!

    (Can you tell I'm excited?)

    GOD BLESS YOU!!!

    ReplyDelete
    Replies
    1. Hahaha glad I could help out! That is exactly why I made this post - took me a while to find the way to do this and there seems to be little info out there for this process.

      Delete
  2. You make so many great points here that I read your article a couple of times. Your views are in accordance with my own for the most part. This is great content for your readers. Compress JPEG Images Online

    ReplyDelete