Skip to content

Instantly share code, notes, and snippets.

@emersondemetrio
Created May 15, 2024 17:30
Show Gist options
  • Save emersondemetrio/0e76d7b50e10250a3d03a467a57449f2 to your computer and use it in GitHub Desktop.
Save emersondemetrio/0e76d7b50e10250a3d03a467a57449f2 to your computer and use it in GitHub Desktop.
Cannon CR2 to JPG
#!/bin/bash
input_dir="./input"
output_dir="./output"
mkdir -p "$output_dir"
# Loop through all CR2 files in the input directory
for file in "$input_dir"/*.CR2; do
echo "Converting $file"
filename=$(basename -- "$file")
sips -s format jpeg -s formatOptions 100 "$file" --out "$output_dir/$filename-output.jpg"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment