19 lines
500 B
Text
19 lines
500 B
Text
|
|
#!/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
|