GIMP rotacija slika u Thunaru

Misko_2083

Member
Joined
Mar 15, 2015
Messages
306
Reaction score
18
Ovo je moja verzija skripta za Thunar custom akcije za rotaciju slika ili fotografija.
Napravite gimp-rotate.sh bilo gde želite sledeće sadržine:

Code:
#!/bin/sh
[HEADING=1]Rotate with python-fu[/HEADING]
if [ $# -ne 2 ];
then
echo ‘Usage: gimp-rotate.sh “file” [right|left|180]’
exit
fi

case “$2” in
right)
OPT=0
;;
left)
OPT=2
;;
180)
OPT=1
;;
*)
echo ‘Usage: gimp-rotate.sh “file” [right|left|180]’
exit
;;
esac

gimp -d -i --batch-interpreter=python-fu-eval -b - << EOF
import gimpfu

def rotate(filename):
img = pdb.gimp_file_load(filename, filename)
layer = pdb.gimp_image_merge_visible_layers(img, 1)
pdb.gimp_image_rotate(img, ‘${OPT}’)
pdb.gimp_file_save(img, layer, filename, filename)
pdb.gimp_image_delete(img)

rotate(’${1}’)

pdb.gimp_quit(1)
EOF
Napravite da skript bude izvršni (chmod +x)

Sada, podesite Thunar
  1. Name: Rotate Right
    Description: Rotate Right with GIMP
    Command: for file in %F; do /path/to/gimp-rotate.sh $file right; done
    Appearance: *
  2. Images
  3. Name: Rotate Left
    Description: Rotate Left with GIMP
    Command: for file in %F; do /path/to/gimp-rotate.sh $file left; done
    Appearance: *
  4. Images
  5. Name: Rotate 180
    Description: Rotate 180 with GIMP
    Command: for file in %F; do /path/to/gimp-rotate.sh $file 180; done
    Appearance: *
  6. Images
    Testirano na TRIOS Mia
 
Last edited:

Misko_2083

Member
Joined
Mar 15, 2015
Messages
306
Reaction score
18
Izvinjavam se. Sada sam primetio da nema navodnika u komandama.
Ovako se podešava Thunar

1. Name: Rotate Right Description: Rotate Right with GIMP Command: for file in %F; do /path/to/gimp-rotate.sh "$file" right; done Appearance: * [*] Images 2. Name: Rotate Left Description: Rotate Left with GIMP Command: for file in %F; do /path/to/gimp-rotate.sh "$file" left; done Appearance: * [*] Images 3. Name: Rotate 180 Description: Rotate 180 with GIMP Command: for file in %F; do /path/to/gimp-rotate.sh "$file" 180; done Appearance: * [*] Images
 
Last edited:
Top