Add .desktop files to restore lossless jpeg rotation via editors.
authorLaurent Monin <geeqie@norz.org>
Tue, 26 May 2009 19:41:22 +0000 (19:41 +0000)
committerLaurent Monin <geeqie@norz.org>
Tue, 26 May 2009 19:41:22 +0000 (19:41 +0000)
configure.in
plugins/Makefile.am
plugins/rotate/Makefile.am [new file with mode: 0644]
plugins/rotate/geeqie-rotate [new file with mode: 0755]
plugins/rotate/rotate180.desktop [new file with mode: 0644]
plugins/rotate/rotate270.desktop [new file with mode: 0644]
plugins/rotate/rotate90.desktop [new file with mode: 0644]

index 70d3f8c..4296924 100644 (file)
@@ -406,6 +406,7 @@ AC_CONFIG_FILES([
     doc/Makefile
     plugins/Makefile
     plugins/symlink/Makefile
+    plugins/rotate/Makefile
     geeqie.spec
 ])
 
index 7eae3ef..1c0682c 100644 (file)
@@ -1,6 +1,5 @@
-SUBDIRS = symlink
+SUBDIRS = rotate symlink
 qq_desktoptemplatedir = $(pkgdatadir)
 qq_desktoptemplate_DATA = template.desktop
 
-EXTRA_DIST = \
-       $(qq_desktoptemplate_DATA)
+EXTRA_DIST = $(qq_desktoptemplate_DATA)
diff --git a/plugins/rotate/Makefile.am b/plugins/rotate/Makefile.am
new file mode 100644 (file)
index 0000000..c37ebfc
--- /dev/null
@@ -0,0 +1,7 @@
+dist_bin_SCRIPTS = geeqie-rotate
+
+qq_desktopdir = $(pkgdatadir)/applications
+qq_desktop_DATA = rotate90.desktop rotate180.desktop rotate270.desktop
+
+EXTRA_DIST = $(qq_desktop_DATA)
+
diff --git a/plugins/rotate/geeqie-rotate b/plugins/rotate/geeqie-rotate
new file mode 100755 (executable)
index 0000000..7abe42b
--- /dev/null
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+# This is a helper script that rotate jpeg files using jpegtran
+
+rotation=$1
+shift
+
+for file in "$@" ; do
+       tmp="$file".$$
+       if jpegtran -rotate "$rotation" -copy all -outfile "$tmp" "$file"; then
+               mv -f "$tmp" "$file";
+       else
+               rm -f "$tmp";
+       fi
+done
diff --git a/plugins/rotate/rotate180.desktop b/plugins/rotate/rotate180.desktop
new file mode 100644 (file)
index 0000000..a797d27
--- /dev/null
@@ -0,0 +1,20 @@
+[Desktop Entry]
+Version=1.0
+Type=Application
+Name=Rotate 180 degrees
+Name[fr]=Rotation 180°
+
+# call the helper script
+Exec=geeqie-rotate 180 %f
+
+# Desktop files that are usable only in Geeqie should be marked like this:
+Categories=X-Geeqie;
+OnlyShowIn=X-Geeqie;
+
+# Show in menu "File"
+X-Geeqie-Menu-Path=FileMenu/FileOpsSection
+
+# It can be made verbose
+#X-Geeqie-Verbose=true
+
+MimeType=image/jpeg;image/jpg;
diff --git a/plugins/rotate/rotate270.desktop b/plugins/rotate/rotate270.desktop
new file mode 100644 (file)
index 0000000..9db06b8
--- /dev/null
@@ -0,0 +1,20 @@
+[Desktop Entry]
+Version=1.0
+Type=Application
+Name=Rotate 90 degrees counterclockwise
+Name[fr]=Rotation 90° vers la gauche
+
+# call the helper script
+Exec=geeqie-rotate 270 %f
+
+# Desktop files that are usable only in Geeqie should be marked like this:
+Categories=X-Geeqie;
+OnlyShowIn=X-Geeqie;
+
+# Show in menu "File"
+X-Geeqie-Menu-Path=FileMenu/FileOpsSection
+
+# It can be made verbose
+#X-Geeqie-Verbose=true
+
+MimeType=image/jpeg;image/jpg;
diff --git a/plugins/rotate/rotate90.desktop b/plugins/rotate/rotate90.desktop
new file mode 100644 (file)
index 0000000..b2ac114
--- /dev/null
@@ -0,0 +1,20 @@
+[Desktop Entry]
+Version=1.0
+Type=Application
+Name=Rotate 90 degrees clockwise
+Name[fr]=Rotation 90° vers la droite
+
+# call the helper script
+Exec=geeqie-rotate 90 %f
+
+# Desktop files that are usable only in Geeqie should be marked like this:
+Categories=X-Geeqie;
+OnlyShowIn=X-Geeqie;
+
+# Show in menu "File"
+X-Geeqie-Menu-Path=FileMenu/FileOpsSection
+
+# It can be made verbose
+#X-Geeqie-Verbose=true
+
+MimeType=image/jpeg;image/jpg;