Author Topic: Batch edit the camera model for a folder  (Read 3190 times)

happygun

  • Newbie
  • *
  • Posts: 5
Batch edit the camera model for a folder
« on: March 15, 2013, 05:52:22 AM »
Hi all,

not too hot with command line utilities. How do i batch edit the camera model for all nef files in a folder?

Phil Harvey

  • ExifTool Author
  • Administrator
  • ExifTool Freak
  • *****
  • Posts: 14405
    • ExifTool Home Page
Re: Batch edit the camera model for a folder
« Reply #1 on: March 15, 2013, 07:57:34 AM »
exiftool -model="some model name" -ext nef FOLDER_NAME

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

happygun

  • Newbie
  • *
  • Posts: 5
Re: Batch edit the camera model for a folder
« Reply #2 on: March 15, 2013, 08:45:38 AM »
Many thanks Phil. Can now open d7100 nef files in lightroom!

happygun

  • Newbie
  • *
  • Posts: 5
Re: Batch edit the camera model for a folder
« Reply #3 on: March 15, 2013, 04:28:34 PM »
One more question Phil.

Once i have edited the camera model, Lightroom can then import these files. AT some point in the future when lightroom can read d7100 files, can i point exiftool to a directory (including subfolders) and change metadata for all files where camera model = 'Nikon D5200', from 'Nikon D5200' to 'Nikon D7100'

Phil Harvey

  • ExifTool Author
  • Administrator
  • ExifTool Freak
  • *****
  • Posts: 14405
    • ExifTool Home Page
Re: Batch edit the camera model for a folder
« Reply #4 on: March 15, 2013, 04:47:46 PM »
Yes:   exiftool -if "$model eq 'Nikon D5200'" -model="Nikon D7100" -r DIR

(the quoting above is for Windows, swap the single and double quotes if you are on Mac or Linux)

Or, if you still have the "_original" backups, and want to simply restore all of them:

exiftool -restore_original -r DIR

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

happygun

  • Newbie
  • *
  • Posts: 5
Re: Batch edit the camera model for a folder
« Reply #5 on: March 15, 2013, 05:24:40 PM »
Hi Phil,

what switch in that command tells exiftool which directory to look in, or do i replace DIR with the directory?

StarGeek

  • Global Moderator
  • ExifTool Freak
  • *****
  • Posts: 2365
Re: Batch edit the camera model for a folder
« Reply #6 on: March 15, 2013, 07:17:20 PM »
what switch in that command tells exiftool which directory to look in, or do i replace DIR with the directory?

Replace DIR with the directory.  The -r switch tells it to recurse into subdirectories.
Troubleshooting hints:
* When posting, include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).
* Double all percent signs (%) in a Windows batch file.
* If your GPS coords are negative, make sure and set the GpsLatitudeRef and GpsLongitudeRef tags correctly.

happygun

  • Newbie
  • *
  • Posts: 5
Re: Batch edit the camera model for a folder
« Reply #7 on: March 15, 2013, 08:11:37 PM »
CHeer, i thought that was the case but command line switches occasionally mystify me....