Skip to content

Instantly share code, notes, and snippets.

@jbuchbinder
Created June 5, 2013 19:06
Show Gist options
  • Save jbuchbinder/5716321 to your computer and use it in GitHub Desktop.
Save jbuchbinder/5716321 to your computer and use it in GitHub Desktop.
Transfer EXIF data to retouched photos using exiv2 utility.
#!/bin/bash
#
# Transfer EXIF data to retouched photos using exiv2 utility.
# Assumes that retouched photos are ${ORIGINAL_PREFIX}_retouched.jpg
# @jbuchbinder / jbuchbinder.com
#
for R in *_retouched.jpg; do
O=${R//_retouched.jpg}.jpg
echo " * Processing $O -> $R"
OE=${O//.jpg}.exv
RE=${R//.jpg}.exv
# Extract EXIF data
exiv2 ex "$O"
mv "$OE" "$RE" -f
exiv2 in "$R"
rm "$RE" -f
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment