photoprism/docker/scripts/heif-convert.sh
Peter Doherty 035ed97033
Add -overwrite_original option to exiftool (#1201)
Add -overwrite_original option to exiftool to avoid creating a copy of
the image file.
Adds -P option to preserve file modification time
2021-04-19 11:19:04 +02:00

15 lines
355 B
Bash
Executable file

#!/usr/bin/env bash
if [[ -z $1 ]] && [[ -z $2 ]]; then
echo "USAGE: heif-convert <filename> <output>" 1>&2
exit 1
fi
# USAGE: heif-convert [-q quality 0..100] <filename> <output>
/usr/bin/heif-convert -q 92 "$1" "$2"
# Remove Exif orientation flag as JPEG is rotated already:
/usr/bin/exiftool -overwrite_original -P -n -Orientation=1 "$2"