Skip to content

Instantly share code, notes, and snippets.

@micksmix
Forked from ccnokes/heic_to_jpeg.sh
Created September 7, 2022 04:02
Show Gist options
  • Save micksmix/a41f7a5397d72f0c5ba3ba10177d30b5 to your computer and use it in GitHub Desktop.
Save micksmix/a41f7a5397d72f0c5ba3ba10177d30b5 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