dotfiles-rene/heic-scripts/heic2jpg

19 lines
500 B
Text
Raw Normal View History

2026-02-19 10:55:48 +01:00
#!/bin/bash
# HEIC zu JPG konvertieren
# 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"
if [[ "$RESIZE" == true ]] && [[ -f "$output" ]]; then
mogrify -resize 1920x1920\> "$output"
fi
fi
done