Skip to content

Instantly share code, notes, and snippets.

@ccnokes
Last active November 21, 2022 16:06
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save ccnokes/2562c9d25a84ec7f4e0b7137aca7ede0 to your computer and use it in GitHub Desktop.
Save ccnokes/2562c9d25a84ec7f4e0b7137aca7ede0 to your computer and use it in GitHub Desktop.
Bash script that converts .HEIC to .jpg files
#!/bin/bash
set -eu -o pipefail
count=$(find . -depth 1 -name "*.HEIC" | wc -l | sed 's/[[:space:]]*//')
echo "converting $count files .HEIC files to .jpg"
magick mogrify -monitor -format jpg *.HEIC
echo "Remove .HEIC files? [y/n]"
read remove
if [[ "$remove" == "y" ]]; then
find . -depth 1 -name "*.HEIC" -delete
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment