Last active
September 24, 2024 19:49
-
-
Save ccnokes/2562c9d25a84ec7f4e0b7137aca7ede0 to your computer and use it in GitHub Desktop.
Bash script that converts .HEIC to .jpg files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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