Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- # Ordner mit Bildern (hier aktuelles Verzeichnis)
- BILDER_ORDNER="./"
- # Bildformate anpassen, falls nötig
- BILDFORMATE=("*.jpg" "*.jpeg" "*.png")
- # Über alle Bildformate iterieren
- for format in "${BILDFORMATE[@]}"; do
- for bild in "$BILDER_ORDNER"/$format; do
- # Prüfen, ob Datei existiert (falls kein Match)
- [ -e "$bild" ] || continue
- # Bildgröße auslesen (Breite x Höhe)
- read width height <<< $(identify -format "%w %h" "$bild")
- # Prüfen, ob Breite größer als Höhe ist
- if [ "$width" -gt "$height" ]; then
- echo "Drehe $bild (Breite: $width, Höhe: $height) um 270°..."
- mogrify -rotate 270 "$bild"
- else
- echo "Überspringe $bild (Breite: $width, Höhe: $height)"
- fi
- done
- done
- echo "Fertig!"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement