Created
October 13, 2022 09:51
-
-
Save medvedev/6e6fd7eabd0852c5765e870a36bcf5ec to your computer and use it in GitHub Desktop.
Shell script for batch convertation of HEIC images to JPEGs
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 | |
# Batch convert provided heic photos to jpeg | |
hash heif-convert 2>/dev/null || { printf >&2 "heif-convert is required.\nTry installing it with: \nsudo apt install libheif-examples\n"; exit 1; } | |
if [ $# -eq 0 ] ; then | |
echo >&2 "usage: heic-tojpg.sh <filename1.heic> <filename2.heic> ..." | |
exit 1; | |
fi | |
for filename in "$@" | |
do | |
heif-convert "$filename" "${filename%.*}.jpg" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment