added possibility to use geeqie-rotate as a standalone script
authorVladimir Nadvornik <nadvornik@suse.cz>
Sun, 13 Sep 2009 09:55:21 +0000 (09:55 +0000)
committerVladimir Nadvornik <nadvornik@suse.cz>
Sun, 13 Sep 2009 09:55:21 +0000 (09:55 +0000)
plugins/rotate/geeqie-rotate
plugins/rotate/rotate.desktop.in

index e97e74c..939c272 100755 (executable)
@@ -47,13 +47,23 @@ rotate()
     esac
 }
 
+get_sidecars=
+if [ "x$1" == "x-g" ] ; then
+    get_sidecars=yes
+    shift
+fi
+
 # iterate over files on commandline
 for file in "$@" ; do
-    # we got only one file for each group, typically the main one
-    # get the sidecars:
-    geeqie -r --get-sidecars:"$file" |while read sidecar ; do
-       # the main file is included in the sidecar file list, no special handling is required
-       rotate "$sidecar"
-    done
+    if [ -n "$get_sidecars" ] ; then
+        # we got only one file for each group, typically the main one
+        # get the sidecars:
+        geeqie -r --get-sidecars:"$file" |while read sidecar ; do
+            # the main file is included in the sidecar file list, no special handling is required
+            rotate "$sidecar"
+        done
+    else
+        rotate "$file"
+    fi
 done
 
index a403591..65e1b6f 100644 (file)
@@ -4,7 +4,7 @@ Type=Application
 _Name=Apply the orientation to image content
 
 # call the helper script
-Exec=geeqie-rotate %f
+Exec=geeqie-rotate -g %f
 
 # Desktop files that are usable only in Geeqie should be marked like this:
 Categories=X-Geeqie;