Created
December 31, 2020 16:14
-
-
Save SharkyRawr/e9277e941d1ee48d29daedc6ad8b7984 to your computer and use it in GitHub Desktop.
Script to convert all HEIC files to JPG
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 -ex | |
## REQUIRES imagemagick with HEIC support !!! | |
mkdir -p /tmp/new | |
find . -type f -iname '*.heic' | | |
while read file; do | |
echo $file | |
basefile=$(basename "$file") | |
name="${basefile%.*}" | |
convert "$file" "/tmp/new/$name.jpg" | |
mv -fv "/tmp/new/$name.jpg" "${file%.*}.jpg" | |
touch -r "$file" "${file%.*}.jpg" | |
rm -v "$file" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment