dotfiles-rene/heic-scripts/heic2jpg_delete
2026-03-14 10:02:31 +01:00

18 lines
532 B
Bash
Executable file

#!/bin/bash
# HEIC zu JPG konvertieren und HEIC löschen
# Optional: Bilder auf max. 1920px verkleinern mit --resize
RESIZE=false
if [[ "$1" == "--resize" ]] || [[ "$NEMO_SCRIPT_SELECTED_FILE_PATHS" == *"--resize"* ]]; then
RESIZE=true
fi
for file in *.{heic,HEIC}; do
if [[ -f "$file" ]]; then
output="${file%.*}.jpg"
heif-convert -q 90 "$file" "$output" && rm "$file"
if [[ "$RESIZE" == true ]] && [[ -f "$output" ]]; then
mogrify -resize 1920x1920\> "$output"
fi
fi
done