Skip to content

Instantly share code, notes, and snippets.

@edhelas
Created April 14, 2025 12:06
Show Gist options
  • Save edhelas/865becfad76e9a219b4e1a45f2856e87 to your computer and use it in GitHub Desktop.
Save edhelas/865becfad76e9a219b4e1a45f2856e87 to your computer and use it in GitHub Desktop.
A little script to extract JPG from CR2 files and copy the EXIF metadate to them
#!/bin/bash
echo "Convert $1 directory"
exiftool -b -PreviewImage -orientation -w .jpg -ext cr2 -r "$1"
echo "Copy EXIF"
cd "$1"
for file in *.CR2; do
exiftool -tagsFromFile "$file" ${file::-4}.jpg
done
echo "Cleaning up"
rm *_original
if [ "$2" = "clean" ]
then
echo "Removing the CR2 files"
rm *.CR2
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment