#!/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