Hello community,
here is the log from the commit of package qv
checked in at Thu Sep 13 18:56:50 CEST 2007.
--------
--- qv/qv.changes 2007-06-21 17:12:58.000000000 +0200
+++ /mounts/work_src_done/STABLE/qv/qv.changes 2007-09-13 17:07:13.000000000 +0200
@@ -1,0 +2,9 @@
+Thu Sep 13 17:06:59 CEST 2007 - kukuk@suse.de
+
+- Version 0.8
+ - Bug fixing
+ - Add support to rotate images
+ - Add support to copy images
+ - Add support to move images
+
+-------------------------------------------------------------------
Old:
----
qv-0.7.tar.bz2
New:
----
qv-0.8.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ qv.spec ++++++
--- /var/tmp/diff_new_pack.w13231/_old 2007-09-13 18:56:27.000000000 +0200
+++ /var/tmp/diff_new_pack.w13231/_new 2007-09-13 18:56:27.000000000 +0200
@@ -1,5 +1,5 @@
#
-# spec file for package qv (Version 0.7)
+# spec file for package qv (Version 0.8)
#
# Copyright (c) 2007 SUSE LINUX Products GmbH, Nuernberg, Germany.
# This file and all modifications and additions to the pristine
@@ -13,11 +13,11 @@
Name: qv
Summary: Quick Viewer for Pictures and Slideshows
BuildRequires: gtk2-devel libexif-devel
-Version: 0.7
+Requires: exiftran
+Version: 0.8
Release: 1
-License: GNU General Public License (GPL)
+License: GPL v2 only
Autoreqprov: on
-Prefix: %{_prefix}
Group: Productivity/Graphics/Viewers
Source: %{name}-%{version}.tar.bz2
BuildRoot: %{_tmppath}/%{name}-%{version}-build
@@ -45,6 +45,12 @@
%{_bindir}/qv
%changelog
+* Thu Sep 13 2007 - kukuk@suse.de
+- Version 0.8
+ - Bug fixing
+ - Add support to rotate images
+ - Add support to copy images
+ - Add support to move images
* Thu Jun 21 2007 - kukuk@suse.de
- Version 0.7
- Add sanity checks to suppress compiler warnings
++++++ qv-0.7.tar.bz2 -> qv-0.8.tar.bz2 ++++++
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/qv-0.7/aclocal.m4 new/qv-0.8/aclocal.m4
--- old/qv-0.7/aclocal.m4 2007-06-21 17:12:19.000000000 +0200
+++ new/qv-0.8/aclocal.m4 2007-09-13 16:24:19.000000000 +0200
@@ -154,7 +154,8 @@
_PKG_TEXT
])],
- [$4])
+ [AC_MSG_RESULT([no])
+ $4])
elif test $pkg_failed = untried; then
ifelse([$4], , [AC_MSG_FAILURE(dnl
[The pkg-config script could not be found or is too old. Make sure it
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/qv-0.7/ChangeLog new/qv-0.8/ChangeLog
--- old/qv-0.7/ChangeLog 2007-06-21 17:11:09.000000000 +0200
+++ new/qv-0.8/ChangeLog 2007-09-13 16:21:38.000000000 +0200
@@ -1,3 +1,31 @@
+2007-09-13 Thorsten Kukuk
+
+ * release version 0.8
+
+ * src/event_handler.c: Use exiftran to rotate images.
+
+ * src/window.c (calc_window_size): Fix handling of maxpect in
+ fullscreen mode.
+
+ * src/qv.c (main): Add option for move dir.
+
+ * src/event_handler.c (move_image): New function.
+
+2007-09-11 Thorsten Kukuk
+
+ * src/event_handler.c: Implement copy function for images.
+
+ * src/qv.h: Add prototype for copy_dir.
+ * src/qv.c: Add -C <dir> option.
+
+2007-09-09 Thorsten Kukuk
+
+ * src/exif.c: Fix Lenstype, add picture style.
+
+2007-08-14 Thorsten Kukuk
+
+ * src/event_handler.c: Add C for copy image support.
+
2007-06-21 Thorsten Kukuk
* release version 0.7
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/qv-0.7/configure new/qv-0.8/configure
--- old/qv-0.7/configure 2007-06-21 17:12:21.000000000 +0200
+++ new/qv-0.8/configure 2007-09-13 16:24:21.000000000 +0200
@@ -2058,7 +2058,7 @@
# Define the identity of the package.
PACKAGE=qv
- VERSION=0.7
+ VERSION=0.8
cat >>confdefs.h <<_ACEOF
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/qv-0.7/configure.in new/qv-0.8/configure.in
--- old/qv-0.7/configure.in 2007-06-21 17:11:40.000000000 +0200
+++ new/qv-0.8/configure.in 2007-09-13 16:24:13.000000000 +0200
@@ -1,6 +1,6 @@
dnl Process this file with autoconf to produce a configure script.
AC_INIT(src/qv.c)
-AM_INIT_AUTOMAKE(qv, 0.7)
+AM_INIT_AUTOMAKE(qv, 0.8)
AM_CONFIG_HEADER(config.h)
AC_SUBST(PACKAGE)
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/qv-0.7/NEWS new/qv-0.8/NEWS
--- old/qv-0.7/NEWS 2007-06-21 17:12:15.000000000 +0200
+++ new/qv-0.8/NEWS 2007-09-13 16:23:48.000000000 +0200
@@ -4,6 +4,13 @@
Please send bug reports, questions and suggestions to .
+
+* Version 0.8
+- Bug fixing
+- Add support to rotate images
+- Add support to copy images
+- Add support to move images
+
* Version 0.7
- Add some sanity checks
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/qv-0.7/po/Makevars new/qv-0.8/po/Makevars
--- old/qv-0.7/po/Makevars 2006-09-05 16:07:28.000000000 +0200
+++ new/qv-0.8/po/Makevars 2007-09-13 16:27:48.000000000 +0200
@@ -34,7 +34,7 @@
# It can be your email address, or a mailing list address where translators
# can write to without being subscribed, or the URL of a web page through
# which the translators can contact you.
-MSGID_BUGS_ADDRESS =
+MSGID_BUGS_ADDRESS = kukuk@thkukuk.de
# This is the list of locale categories, beyond LC_MESSAGES, for which the
# message catalogs shall be used. It is usually empty.
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/qv-0.7/po/qv.pot new/qv-0.8/po/qv.pot
--- old/qv-0.7/po/qv.pot 2007-06-21 17:12:25.000000000 +0200
+++ new/qv-0.8/po/qv.pot 2007-09-13 16:59:48.000000000 +0200
@@ -7,8 +7,8 @@
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
-"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2007-06-21 17:12+0200\n"
+"Report-Msgid-Bugs-To: kukuk@thkukuk.de\n"
+"POT-Creation-Date: 2007-09-13 16:59+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME \n"
"Language-Team: LANGUAGE \n"
@@ -16,100 +16,132 @@
"Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: 8bit\n"
-#: src/event_handler.c:37
+#: src/event_handler.c:43
msgid "PgDn/space Next picture"
msgstr ""
-#: src/event_handler.c:38
+#: src/event_handler.c:44
msgid "PgUp/backspace/right mouse Previous picture"
msgstr ""
-#: src/event_handler.c:39
+#: src/event_handler.c:45
msgid "q/ESC Exit"
msgstr ""
-#: src/event_handler.c:41
+#: src/event_handler.c:47
msgid "?/F1 Show keys"
msgstr ""
-#: src/event_handler.c:42
+#: src/event_handler.c:48
msgid "= Adjust image to window"
msgstr ""
-#: src/event_handler.c:43
+#: src/event_handler.c:49
msgid "1 Zoom 1:1"
msgstr ""
-#: src/event_handler.c:44
+#: src/event_handler.c:50
msgid "c Center window"
msgstr ""
-#: src/event_handler.c:45
+#: src/event_handler.c:51
+msgid "C Copy picture"
+msgstr ""
+
+#: src/event_handler.c:52
msgid "d/DEL Delete picture"
msgstr ""
-#: src/event_handler.c:46
+#: src/event_handler.c:53
msgid "e Display EXIF data"
msgstr ""
-#: src/event_handler.c:47
+#: src/event_handler.c:54
msgid "E Edit image note file"
msgstr ""
-#: src/event_handler.c:48
+#: src/event_handler.c:55
msgid "f Fullscreen mode on/off"
msgstr ""
-#: src/event_handler.c:49
+#: src/event_handler.c:56
msgid "g Open image with gimp"
msgstr ""
-#: src/event_handler.c:50
+#: src/event_handler.c:57
msgid "h Histogram on/off"
msgstr ""
-#: src/event_handler.c:51
+#: src/event_handler.c:58
msgid "i Statusbar on/off"
msgstr ""
-#: src/event_handler.c:52
+#: src/event_handler.c:59
msgid "m Maxpect on/off"
msgstr ""
-#: src/event_handler.c:53
+#: src/event_handler.c:60
+msgid "M Move picture to another directory"
+msgstr ""
+
+#: src/event_handler.c:61
+msgid "r 9|1|2 Rotate picutre by 90,180,270"
+msgstr ""
+
+#: src/event_handler.c:62
msgid "s Slideshow on/off"
msgstr ""
-#: src/event_handler.c:54
+#: src/event_handler.c:63
msgid "t Display description"
msgstr ""
-#: src/event_handler.c:55
+#: src/event_handler.c:64
msgid "Arrow Keys Move image"
msgstr ""
-#: src/event_handler.c:56
+#: src/event_handler.c:65
msgid "Shift+Arrow Keys Move image by window size"
msgstr ""
-#: src/event_handler.c:105
+#: src/event_handler.c:114
msgid "No description found"
msgstr ""
-#: src/event_handler.c:170 src/event_handler.c:189
+#: src/event_handler.c:179 src/event_handler.c:198 src/event_handler.c:231
#, c-format
msgid "execlp failed: %m\n"
msgstr ""
-#: src/exif.c:160
+#: src/event_handler.c:315
+#, c-format
+msgid "Cannot copy image: %m"
+msgstr ""
+
+#: src/event_handler.c:320
+#, c-format
+msgid "Image copied to %s"
+msgstr ""
+
+#: src/event_handler.c:355
+#, c-format
+msgid "Cannot move image: %m"
+msgstr ""
+
+#: src/event_handler.c:371
+#, c-format
+msgid "Image moved to %s"
+msgstr ""
+
+#: src/exif.c:159
msgid "GPS Position"
msgstr ""
-#: src/exif.c:190
+#: src/exif.c:189
msgid "No EXIF data found"
msgstr ""
-#: src/exif.c:241
+#: src/exif.c:264 src/exif.c:270 src/exif.c:279 src/exif.c:285
msgid "Lens"
msgstr ""
@@ -117,7 +149,7 @@
msgid "File not found:"
msgstr ""
-#: src/qv.c:55
+#: src/qv.c:58
#, c-format
msgid ""
"Copyright (C) %s Thorsten Kukuk.\n"
@@ -125,87 +157,91 @@
"warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n"
msgstr ""
-#: src/qv.c:67
+#: src/qv.c:70
#, c-format
msgid "Try `%s --help' for more information.\n"
msgstr ""
-#: src/qv.c:74
+#: src/qv.c:77
#, c-format
msgid "%s - Quick Viewer\n"
msgstr ""
-#: src/qv.c:75
+#: src/qv.c:78
#, c-format
msgid ""
"Usage: %s [options] files ...\n"
"\n"
msgstr ""
-#: src/qv.c:77
+#: src/qv.c:80
msgid " -c, --center Open window centered\n"
msgstr ""
-#: src/qv.c:78
+#: src/qv.c:81
+msgid " -C, --copy <dir> Copy images in directory <dir>\n"
+msgstr ""
+
+#: src/qv.c:82
msgid " -d, --delay secs Set slideshow delay to secs seconds\n"
msgstr ""
-#: src/qv.c:80
+#: src/qv.c:84
msgid " -f, --fullscreen Start in fullscreen mode\n"
msgstr ""
-#: src/qv.c:81
+#: src/qv.c:85
msgid " -F, --file <file> Read <file> for images to show\n"
msgstr ""
-#: src/qv.c:82
+#: src/qv.c:86
msgid " -h, --histogram Display histogram window\n"
msgstr ""
-#: src/qv.c:83
+#: src/qv.c:87
msgid " -i, --statusbar Display statusbar\n"
msgstr ""
-#: src/qv.c:84
+#: src/qv.c:88
msgid " -m, --maxpect Turn maxpect on\n"
msgstr ""
-#: src/qv.c:85
+#: src/qv.c:89
msgid " --no-wm No WindowManager is running\n"
msgstr ""
-#: src/qv.c:86
+#: src/qv.c:90
msgid " -r, --read-only Don't modify/delete images on disk\n"
msgstr ""
-#: src/qv.c:87
+#: src/qv.c:91
msgid " -s, --slideshow Start slideshow immediately\n"
msgstr ""
-#: src/qv.c:88
+#: src/qv.c:92
msgid " -v, --version Print program version\n"
msgstr ""
-#: src/qv.c:89
+#: src/qv.c:93
msgid " --help Give this help list\n"
msgstr ""
-#: src/qv.c:183
+#: src/qv.c:187
#, c-format
msgid "Cannot open file '%s' for reading: %m\n"
msgstr ""
-#: src/qv.c:284
+#: src/qv.c:293
#, c-format
msgid "delay argument contains invalid numerical value: %s\n"
msgstr ""
-#: src/qv.c:291
+#: src/qv.c:300
#, c-format
msgid "%s: delay value too big\n"
msgstr ""
-#: src/qv.c:338
+#: src/qv.c:350
#, c-format
msgid "%s: Too few arguments.\n"
msgstr ""
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/qv-0.7/src/event_handler.c new/qv-0.8/src/event_handler.c
--- old/qv-0.7/src/event_handler.c 2007-06-21 17:11:24.000000000 +0200
+++ new/qv-0.8/src/event_handler.c 2007-09-13 16:59:43.000000000 +0200
@@ -18,9 +18,14 @@
#include "config.h"
#endif
+#include
+#include
#include
#include
#include
+#include
+#include
+#include
#include "qv.h"
@@ -29,6 +34,7 @@
gboolean displaying_textwindow = FALSE;
static gboolean restart_slideshow = FALSE;
int do_resize_window = 0;
+static gboolean rotate_image = FALSE;
const char *helpstrs[] =
{
@@ -42,6 +48,7 @@
N_("= Adjust image to window"),
N_("1 Zoom 1:1"),
N_("c Center window"),
+ N_("C Copy picture"),
N_("d/DEL Delete picture"),
N_("e Display EXIF data"),
N_("E Edit image note file"),
@@ -50,6 +57,8 @@
N_("h Histogram on/off"),
N_("i Statusbar on/off"),
N_("m Maxpect on/off"),
+ N_("M Move picture to another directory"),
+ N_("r 9|1|2 Rotate picutre by 90,180,270"),
N_("s Slideshow on/off"),
N_("t Display description"),
N_("Arrow Keys Move image"),
@@ -104,7 +113,7 @@
static const char *errorstr[] =
{N_("No description found"), NULL};
- display_text_window (q, errorstr);
+ display_text_window (q, errorstr, 1);
free (filename);
return;
}
@@ -127,7 +136,7 @@
fclose (fp);
free (buf);
- display_text_window (q, (const char **)output);
+ display_text_window (q, (const char **)output, 1);
for (line = 0; line < MAX_LINES; line++)
if (output[line])
@@ -190,6 +199,187 @@
}
+static void
+run_exiftran (qv_image *q, const char *arg)
+{
+ pid_t pid;
+ int i;
+
+ pid = fork ();
+
+ if (pid > 0) /* parent */
+ {
+ int st;
+
+ waitpid (pid, &st, 0);
+
+ if (replace_image (q, q->image_name))
+ {
+ gdk_beep ();
+ return;
+ }
+ gdk_window_clear (q->window);
+ redraw_image (q);
+
+ return;
+ }
+
+ for (i = 0; i < sysconf (_SC_OPEN_MAX); i++)
+ close (i);
+
+ execlp ("exiftran", "exiftran", "-i", arg, q->image_name, NULL);
+ fprintf (stderr, _("execlp failed: %m\n"));
+}
+
+
+static int
+copy_file (const char *srcfile, const char *dstfile)
+{
+ int src_fd, dst_fd;
+ struct stat st;
+
+ if (lstat (srcfile, &st) != 0)
+ return -1;
+
+ src_fd = open (srcfile, O_RDONLY);
+ if (src_fd < 0)
+ return -1;
+
+ dst_fd = open (dstfile, O_WRONLY|O_CREAT|O_TRUNC, 0);
+ if (dst_fd < 0)
+ return -1;
+ else
+ {
+ char buffer[4096];
+ int cnt, ret_errno = 0;
+
+ while ((cnt = read (src_fd, buffer, sizeof (buffer))) > 0)
+ {
+ if (write (dst_fd, buffer, cnt) != cnt)
+ {
+ ret_errno = errno;
+ cnt = -1;
+ break;
+ }
+ }
+ close (src_fd);
+ close (dst_fd);
+ if (cnt >= 0)
+ {
+ if (chmod (dstfile, st.st_mode & 07777) == -1)
+ {
+ ret_errno = errno;
+ cnt = -1;
+ }
+ }
+ if (cnt < 0)
+ {
+ unlink (dstfile);
+ errno = ret_errno;
+ return -1;
+ }
+#if 0 /* XXX add copy_xattr */
+ else if (copy_xattr (srcfile, dstfile) != 0)
+ {
+ unlink (dstfile);
+ unlink (dstfile);
+ return -1;
+ }
+#endif
+ }
+ return 0;
+}
+
+static void
+copy_image (qv_image *q)
+{
+ char *infostr[] = {NULL, NULL};
+
+ char *newpath;
+ const char *cp;
+
+ cp = strrchr (q->image_name, '/');
+ if (cp == NULL)
+ cp = q->image_name;
+ else
+ cp++;
+
+ if (asprintf (&newpath, "%s/%s", copy_dir, cp) < 1)
+ qv_oom ();
+
+ if (access (copy_dir, F_OK) == -1)
+ mkdir (copy_dir, 0722);
+
+ if (copy_file (q->image_name, newpath) == -1)
+ {
+ if (asprintf (&infostr[0], _("Cannot copy image: %m")) < 0)
+ qv_oom ();
+ }
+ else
+ {
+ if (asprintf (&infostr[0], _("Image copied to %s"),
+ newpath) < 0)
+ qv_oom ();
+ }
+
+ free (newpath);
+
+ display_text_window (q, (const char **)infostr, 1);
+ free (infostr[0]);
+}
+
+static void
+move_image (qv_image *q)
+{
+ char *infostr[] = {NULL, NULL};
+
+ char *newpath;
+ const char *cp;
+
+ cp = strrchr (q->image_name, '/');
+ if (cp == NULL)
+ cp = q->image_name;
+ else
+ cp++;
+
+ if (asprintf (&newpath, "%s/%s", move_dir, cp) < 1)
+ qv_oom ();
+
+ if (access (move_dir, F_OK) == -1)
+ mkdir (move_dir, 0722);
+
+ if (rename (q->image_name, newpath) == -1)
+ {
+ if (copy_file (q->image_name, newpath) == -1)
+ {
+ if (asprintf (&infostr[0], _("Cannot move image: %m")) < 0)
+ qv_oom ();
+ goto move_out;
+ }
+ }
+
+ unlink (q->image_name);
+
+ if (replace_image (q, newpath))
+ {
+ gdk_beep ();
+ return;
+ }
+ gdk_window_clear (q->window);
+ redraw_image (q);
+
+ if (asprintf (&infostr[0], _("Image moved to %s"),
+ newpath) < 0)
+ qv_oom ();
+
+ move_out:
+
+ free (newpath);
+
+ display_text_window (q, (const char **)infostr, 1);
+ free (infostr[0]);
+}
+
void
event_handler (GdkEvent *ev, gpointer data)
{
@@ -283,6 +473,36 @@
case GDK_KEY_PRESS:
+ if (rotate_image)
+ {
+ rotate_image = FALSE;
+ /* Hide the text window if it is showing */
+ displaying_textwindow = FALSE;
+ free_strs (q);
+ redraw_image (q);
+ switch (ev->key.keyval)
+ {
+ case 'e':
+ run_exiftran (q, "-a");
+ break;
+ case GDK_9:
+ case GDK_KP_9:
+ run_exiftran (q, "-9");
+ break;
+ case GDK_1:
+ case GDK_KP_1:
+ run_exiftran (q, "-1");
+ break;
+ case GDK_2:
+ case GDK_KP_2:
+ run_exiftran (q, "-2");
+ break;
+ default:
+ gdk_beep ();
+ }
+ break;
+ }
+
if (displaying_textwindow)
{
/* Hide the text window if it is showing */
@@ -432,7 +652,7 @@
slideshow = 0;
g_source_remove (timerid);
}
- display_text_window (q, helpstrs);
+ display_text_window (q, helpstrs, 1);
break;
/* Exit */
@@ -482,6 +702,11 @@
center_window (q);
break;
+ /* Copy picture */
+ case 'C':
+ copy_image (q);
+ break;
+
/* Delete image */
case GDK_Delete:
case 'd':
@@ -593,6 +818,34 @@
redraw_image (q);
break;
+ /* Move picture */
+ case 'M':
+ move_image (q);
+ break;
+
+ /* Rotate picture by 90/180/270 Degree */
+ case 'r':
+ if (!readonly)
+ {
+ char *infostr[] =
+ {
+ "Rotate image by",
+ "",
+ "e = Exif Information",
+ "9 = 90�",
+ "1 = 180�",
+ "2 = 270�",
+ "",
+ "Press e, 9, 1 or 2",
+ NULL
+ };
+ rotate_image = TRUE;
+ display_text_window (q, (const char **)infostr, 0);
+ }
+ else
+ gdk_beep ();
+ break;
+
/* Slideshow on/off */
case 's':
if (slideshow)
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/qv-0.7/src/exif.c new/qv-0.8/src/exif.c
--- old/qv-0.7/src/exif.c 2007-06-21 17:10:14.000000000 +0200
+++ new/qv-0.8/src/exif.c 2007-09-10 15:57:30.000000000 +0200
@@ -29,7 +29,7 @@
#include "qv.h"
-#define MAX_LINES 17
+#define MAX_LINES 18
static void
callback_exif_entry (ExifEntry *ee, void *user_data)
@@ -44,7 +44,7 @@
exif_entry_get_value (ee, buf, sizeof (buf));
- //printf ("name=[%s], value=[%s]\n", name, buf);
+ // printf ("name=[%s], value=[%s]\n", name, buf);
if (strcasecmp (name, "Make") == 0)
{
@@ -155,8 +155,7 @@
setlocale (LC_NUMERIC, "POSIX");
- if (asprintf (&output[13],
- "%20s: %g deg %g' %g'' %s, %g deg %g' %g'' %s",
+ if (asprintf (&output[13], "%20s: %g� %g' %g\" %s, %g� %g' %g\" %s",
_("GPS Position"),
lat_deg, lat_min, lat_sec, gps_latitude_ref,
long_deg, long_min, long_sec, gps_longitude_ref) < 0)
@@ -189,7 +188,7 @@
{
static const char *errorstr[] = {N_("No EXIF data found"), NULL};
- display_text_window (q, errorstr);
+ display_text_window (q, errorstr, 1);
return 1;
}
@@ -205,7 +204,9 @@
c = exif_mnote_data_count (mnd);
if (c > 0)
{
- char *shortfocal = NULL, *longfocal = NULL;
+ char *shortfocal = NULL, *longfocal = NULL, *lenstype = NULL;
+ int have_lens = 0;
+
for (i = 0; i < c; i++)
{
const char *name = exif_mnote_data_get_name (mnd, i);
@@ -219,16 +220,34 @@
value = exif_mnote_data_get_value (mnd, i, buf,
sizeof (buf));
- if (strcasecmp (name, "FirmwareVersion") == 0)
+ // printf ("name=[%s], value=[%s]\n", name, value);
+
+ if (strcasecmp (name, "Picture style") == 0)
{
- if (asprintf (&output[15], "%20s: %s", title, value) < 0)
+ if (asprintf (&output[14], "%20s: %s", title, value) < 0)
qv_oom ();
}
- else if (strcasecmp (name, "OwnerName") == 0)
+ else if (strcasecmp (name, "FirmwareVersion") == 0)
{
if (asprintf (&output[16], "%20s: %s", title, value) < 0)
qv_oom ();
}
+ else if (strcasecmp (name, "OwnerName") == 0)
+ {
+ if (asprintf (&output[17], "%20s: %s", title, value) < 0)
+ qv_oom ();
+ }
+ else if (strcasecmp (name, "Lens type") == 0)
+ {
+ if (value[0] == '0' && value[1] == 'x')
+ lenstype = strdup (value); /* Unknown ID */
+ else
+ {
+ if (asprintf (&output[15], "%20s: %s", title, value) < 0)
+ qv_oom ();
+ have_lens = 1;
+ }
+ }
else if (strcasecmp (name, "Long focal length of lens") == 0)
longfocal = strdup (value);
else if (strcasecmp (name, "Short focal length of lens")
@@ -236,16 +255,45 @@
shortfocal = strdup (value);
}
}
- if (shortfocal || longfocal)
+ if ((shortfocal || longfocal) && have_lens == 0)
{
- if (asprintf (&output[14], "%20s: %s-%s", _("Lens"),
- shortfocal, longfocal) < 0)
- qv_oom ();
+ if (strcmp (shortfocal, longfocal) == 0)
+ {
+ if (lenstype)
+ {
+ if (asprintf (&output[15], "%20s: %s (%s)", _("Lens"),
+ shortfocal, lenstype) < 0)
+ qv_oom ();
+ }
+ else
+ {
+ if (asprintf (&output[15], "%20s: %s", _("Lens"),
+ shortfocal) < 0)
+ qv_oom ();
+ }
+ }
+ else
+ {
+ if (lenstype)
+ {
+ if (asprintf (&output[15], "%20s: %s-%s (%s)", _("Lens"),
+ shortfocal, longfocal, lenstype) < 0)
+ qv_oom ();
+ }
+ else
+ {
+ if (asprintf (&output[15], "%20s: %s-%s", _("Lens"),
+ shortfocal, longfocal) < 0)
+ qv_oom ();
+ }
+ }
if (shortfocal)
free (shortfocal);
if (longfocal)
free (longfocal);
+ if (lenstype)
+ free (lenstype);
}
}
}
@@ -260,7 +308,7 @@
if (output[i] == NULL)
output[i] = strdup ("");
- display_text_window (q, (const char **)output);
+ display_text_window (q, (const char **)output, 1);
for (i = 0; i < MAX_LINES; i++)
if (output[i])
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/qv-0.7/src/images.c new/qv-0.8/src/images.c
--- old/qv-0.7/src/images.c 2007-06-21 14:52:11.000000000 +0200
+++ new/qv-0.8/src/images.c 2007-09-10 15:57:30.000000000 +0200
@@ -113,7 +113,7 @@
if (asprintf (&errorstr[1], "%s %s", _("File not found:"),
image_name) < 0)
qv_oom ();
- display_text_window (q, (const char **)errorstr);
+ display_text_window (q, (const char **)errorstr, 1);
gdk_beep ();
free (errorstr[1]);
return 1;
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/qv-0.7/src/Makefile.am new/qv-0.8/src/Makefile.am
--- old/qv-0.7/src/Makefile.am 2006-10-20 16:04:33.000000000 +0200
+++ new/qv-0.8/src/Makefile.am 2007-09-10 17:16:11.000000000 +0200
@@ -9,7 +9,6 @@
WARNFLAGS = @WARNFLAGS@
AM_CFLAGS = $(WARNFLAGS) -DLOCALEDIR=\"$(localedir)\" \
@GDK_CFLAGS@
-AM_LDFLAGS = @GDK_LIBS@ @EXIF_LIBS@
CLEANFILES = *~
@@ -20,6 +19,7 @@
noinst_HEADERS = qv.h qv-intro.h
qv_SOURCES = qv.c event_handler.c images.c window.c exif.c
+qv_LDADD = @GDK_LIBS@ @EXIF_LIBS@
qv-intro.h: qv-intro.jpg
gdk-pixbuf-csource --name=qv_intro --raw $(srcdir)/qv-intro.jpg > $@
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/qv-0.7/src/Makefile.in new/qv-0.8/src/Makefile.in
--- old/qv-0.7/src/Makefile.in 2007-06-21 17:12:21.000000000 +0200
+++ new/qv-0.8/src/Makefile.in 2007-09-13 16:24:21.000000000 +0200
@@ -61,7 +61,7 @@
am_qv_OBJECTS = qv.$(OBJEXT) event_handler.$(OBJEXT) images.$(OBJEXT) \
window.$(OBJEXT) exif.$(OBJEXT)
qv_OBJECTS = $(am_qv_OBJECTS)
-qv_LDADD = $(LDADD)
+qv_DEPENDENCIES =
DEFAULT_INCLUDES = -I. -I$(top_builddir)@am__isrc@
depcomp = $(SHELL) $(top_srcdir)/depcomp
am__depfiles_maybe = depfiles
@@ -189,11 +189,11 @@
AM_CFLAGS = $(WARNFLAGS) -DLOCALEDIR=\"$(localedir)\" \
@GDK_CFLAGS@
-AM_LDFLAGS = @GDK_LIBS@ @EXIF_LIBS@
CLEANFILES = *~
EXTRA_DIST = qv-intro.jpg
noinst_HEADERS = qv.h qv-intro.h
qv_SOURCES = qv.c event_handler.c images.c window.c exif.c
+qv_LDADD = @GDK_LIBS@ @EXIF_LIBS@
all: all-am
.SUFFIXES:
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/qv-0.7/src/qv.c new/qv-0.8/src/qv.c
--- old/qv-0.7/src/qv.c 2007-06-21 14:41:12.000000000 +0200
+++ new/qv-0.8/src/qv.c 2007-09-13 16:22:00.000000000 +0200
@@ -43,6 +43,9 @@
int maxpect = 0;
int no_wm = 0;
+char *copy_dir = "qv-copy";
+char *move_dir = "qv-move";
+
static int delay = SLIDE_DELAY;
guint timerid;
@@ -75,6 +78,7 @@
fprintf (stdout, _("Usage: %s [options] files ...\n\n"), program);
fputs (_(" -c, --center Open window centered\n"), stdout);
+ fputs (_(" -C, --copy <dir> Copy images in directory <dir>\n"), stdout);
fputs (_(" -d, --delay secs Set slideshow delay to secs seconds\n"),
stdout);
fputs (_(" -f, --fullscreen Start in fullscreen mode\n"), stdout);
@@ -248,12 +252,14 @@
int option_index = 0;
static struct option long_options[] = {
{"center", no_argument, NULL, 'c' },
+ {"copy", required_argument, NULL, 'C' },
{"delay", required_argument, NULL, 'd' },
{"fullscreen", no_argument, NULL, 'f' },
{"file", required_argument, NULL, 'F' },
{"histogram", no_argument, NULL, 'h' },
{"help", no_argument, NULL, 500 },
{"maxpect", no_argument, NULL, 'm' },
+ {"move", required_argument, NULL, 'M' },
{"no-wm", no_argument, NULL, 501 },
{"no_wm", no_argument, NULL, 501 },
{"read-only", no_argument, NULL, 'r' },
@@ -262,7 +268,7 @@
{NULL, 0, NULL, '\0'}
};
- c = getopt_long (argc, argv, "cd:fF:himrsv",
+ c = getopt_long (argc, argv, "cC:d:fF:himM:rsv",
long_options, &option_index);
if (c == (-1))
@@ -272,6 +278,9 @@
case 'c':
center = 1;
break;
+ case 'C':
+ copy_dir = optarg;
+ break;
case 'd':
{
unsigned long val;
@@ -308,6 +317,9 @@
case 'm':
maxpect = 1;
break;
+ case 'M':
+ move_dir = optarg;
+ break;
case 'r':
readonly = 1;
break;
@@ -315,7 +327,7 @@
slideshow = 1;
break;
case 'v':
- print_version (program, "2006");
+ print_version (program, "2007");
return 0;
case 500:
print_help (program);
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/qv-0.7/src/qv.h new/qv-0.8/src/qv.h
--- old/qv-0.7/src/qv.h 2007-06-21 14:38:01.000000000 +0200
+++ new/qv-0.8/src/qv.h 2007-09-13 16:21:45.000000000 +0200
@@ -39,6 +39,7 @@
double load_elapsed; /* time needed to load image */
const char *image_name; /* name of currently loaded image */
char **strs; /* content of text window */
+ int strs_pressanykey; /* Add "Press any key" text */
unsigned int colors[MAX_COLORS]; /* data for histogram */
unsigned int colors_max; /* highest number of one color */
} qv_image;
@@ -58,6 +59,9 @@
extern int maxpect;
extern int do_resize_window;
+extern char *copy_dir;
+extern char *move_dir;
+
extern void qv_exit (int code);
extern void restart_timer (gpointer data);
extern void qv_oom (void);
@@ -86,7 +90,8 @@
extern void create_window (qv_image *q);
extern void center_window (qv_image *q);
extern void print_info_text (qv_image *q);
-extern void display_text_window (qv_image *q, const char *strs[]);
+extern void display_text_window (qv_image *q, const char *strs[],
+ int pressanykey);
extern void draw_histogram (qv_image *q);
extern void calc_window_size (qv_image *q);
extern void qv_window_fullscreen (GdkWindow *window);
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/qv-0.7/src/window.c new/qv-0.8/src/window.c
--- old/qv-0.7/src/window.c 2007-06-21 14:39:40.000000000 +0200
+++ new/qv-0.8/src/window.c 2007-09-13 15:34:04.000000000 +0200
@@ -201,7 +201,10 @@
if (text_w < temp) text_w = temp;
}
- text_h = (i + 2) * (q->text_font->ascent + q->text_font->descent);
+ if (q->strs_pressanykey)
+ i+=2; /* empty line and "Press a key" line */
+
+ text_h = i * (q->text_font->ascent + q->text_font->descent);
gdk_window_process_updates (q->window, TRUE);
@@ -224,20 +227,23 @@
q->strs[i], strlen (q->strs[i]));
}
- /* Display Push Any Key... message */
- gdk_draw_text (q->window, q->text_font, q->text_gc,
- width/2 - gdk_text_width(q->text_font, continue_msg,
- strlen(continue_msg))/2,
- height/2 - text_h/2 - q->text_font->descent +
- (i+2) * (q->text_font->ascent + q->text_font->descent),
- continue_msg, strlen(continue_msg));
+ if (q->strs_pressanykey)
+ {
+ /* Display Push Any Key... message */
+ gdk_draw_text (q->window, q->text_font, q->text_gc,
+ width/2 - gdk_text_width(q->text_font, continue_msg,
+ strlen(continue_msg))/2,
+ height/2 - text_h/2 - q->text_font->descent +
+ (i+2) * (q->text_font->ascent + q->text_font->descent),
+ continue_msg, strlen(continue_msg));
+ }
#endif
gdk_flush ();
}
void
-display_text_window (qv_image *q, const char *strs[])
+display_text_window (qv_image *q, const char *strs[], int pressanykey)
{
unsigned int i;
@@ -246,6 +252,7 @@
for (i = 0; strs[i]; i++)
q->strs[i] = strdup (strs[i]);
q->strs[i] = NULL;
+ q->strs_pressanykey = pressanykey;
displaying_textwindow = TRUE;
@@ -380,7 +387,7 @@
if (!run_fullscreen && !maxpect)
q->win_h-=200;
- if (!maxpect && !run_fullscreen)
+ if (!maxpect)
{
/* sometimes the original image is smaller then the window,
decrease window size. */
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/qv-0.7/TODO new/qv-0.8/TODO
--- old/qv-0.7/TODO 2006-10-16 11:32:40.000000000 +0200
+++ new/qv-0.8/TODO 2007-09-10 15:57:30.000000000 +0200
@@ -1,5 +1,6 @@
+* Copy and Move images
+* Incoporate exiftran [(r)otate (a)uto|(9)0|(1)80|(2)70]
* -F: Store special delay values
* Preload next images
* fontsize
-
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
---------------------------------------------------------------------
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org