Last active
January 13, 2021 00:21
-
-
Save southp/147ec3d427fb217950b20e87e236e650 to your computer and use it in GitHub Desktop.
Convert HEICs in a directory to JPGs.
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 | |
# This script uses Imagemagick to do the trick. | |
# For platfrom-specific installation instruction, please refer to https://imagemagick.org/script/download.php | |
# | |
# Sample usage: find -iname *.heic | xargs -L1 heic-to-jpg.sh | |
heic=$1 | |
if [ ! -f "$heic" ]; then | |
echo "Usage: $(basename $0) <target HEIC file>" | |
exit 0 | |
fi | |
jpg="${heic:0:${#heic}-4}jpg" | |
magick "$heic" -quality -1 -verbose "$jpg" | |
touch -r "$heic" "$jpg" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment