Hello community, here is the log from the commit of package qiv for openSUSE:Factory checked in at 2018-02-22 15:03:07 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/qiv (Old) and /work/SRC/openSUSE:Factory/.qiv.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "qiv" Thu Feb 22 15:03:07 2018 rev:23 rq:578931 version:2.3.2 Changes: -------- --- /work/SRC/openSUSE:Factory/qiv/qiv.changes 2015-02-27 10:59:44.000000000 +0100 +++ /work/SRC/openSUSE:Factory/.qiv.new/qiv.changes 2018-02-22 15:03:11.268402860 +0100 @@ -1,0 +2,32 @@ +Sun Feb 18 18:22:15 UTC 2018 - avin...@opensuse.org + +- update to version 2.3.2: + * fix: window sometimes recentered, when moved around with mouse + * fix Makefile for cross-compiling: Make pkg-config substitutable + * add specfile to build rpm for CentOS + * add option --trashbin to use trash bin instead of .qiv-trash + when deleting images + * add ability (and options) to display JPEG comments + * more sophisticated exiftool call in qiv-command example + * fix inconsistent fixed-zoom behaviour + * Don't try to rotate if file is not an image + * get rid of some more XID collisions + * Fix occasionally erratic behaviour of qiv statusbar + * Fix xpm autodetection with libmagic + * Fix small artefacts in pictures which might happen when running + remote over slow link + * update image after it is exposed in window mode + * fix broken "-no-filter" option libmagic filter now works on + symlinks + * fix linking order in "make debug", did not work in some newer + gcc versions + * turn on EXIF autorotation by default + * Add option to sort files by modification time. + * In case of "watch" option, check image only every 1/10 sec, + instead of every 200us. This was way too short for devices like + RasPi etc. + * Leave jumping mode on invalid input and process input key as if + it was entered in non jumping mode +- cleanup with spec-cleaner + +------------------------------------------------------------------- Old: ---- qiv-2.3.1.tgz New: ---- qiv-2.3.2.tgz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ qiv.spec ++++++ --- /var/tmp/diff_new_pack.MaJYN1/_old 2018-02-22 15:03:12.916343580 +0100 +++ /var/tmp/diff_new_pack.MaJYN1/_new 2018-02-22 15:03:12.920343436 +0100 @@ -1,7 +1,7 @@ # # spec file for package qiv # -# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -17,14 +17,13 @@ Name: qiv -Version: 2.3.1 +Version: 2.3.2 Release: 0 Summary: Probably the fastest and simplest image viewer on the planet License: GPL-2.0+ Group: Productivity/Graphics/Viewers -Url: http://spiegl.de/qiv/ -Source0: http://spiegl.de/qiv/download/qiv-%{version}.tgz -BuildRoot: %{_tmppath}/%{name}-%{version}-build +Url: https://spiegl.de/qiv/ +Source0: https://spiegl.de/qiv/download/qiv-%{version}.tgz BuildRequires: file-devel BuildRequires: gtk2-devel BuildRequires: imlib2-devel @@ -72,8 +71,6 @@ * jump to image number x, jump forward/backward x images - - %prep %setup -q sed -i 's/-O2/$(RPM_OPT_FLAGS)/' Makefile @@ -85,20 +82,16 @@ make %{?_smp_mflags} %install -install -Dpm 755 qiv $RPM_BUILD_ROOT%{_bindir}/qiv -install -Dpm 644 qiv.1 $RPM_BUILD_ROOT%{_mandir}/man1/qiv.1 -install -Dpm 0644 qiv.png $RPM_BUILD_ROOT%{_datadir}/pixmaps/qiv.png -install -Dpm 0644 qiv.desktop $RPM_BUILD_ROOT%{_datadir}/applications/qiv.desktop +install -Dpm 755 qiv %{buildroot}%{_bindir}/qiv +install -Dpm 644 qiv.1 %{buildroot}%{_mandir}/man1/qiv.1 +install -Dpm 0644 qiv.png %{buildroot}%{_datadir}/pixmaps/qiv.png +install -Dpm 0644 qiv.desktop %{buildroot}%{_datadir}/applications/qiv.desktop %suse_update_desktop_file qiv -%clean -rm -rf $RPM_BUILD_ROOT - %files -%defattr(-,root,root,-) %doc README README.COPYING README.TODO contrib %{_bindir}/qiv -%{_mandir}/man1/qiv.1* +%{_mandir}/man1/qiv.1%{ext_man} %{_datadir}/pixmaps/qiv.png %{_datadir}/applications/qiv.desktop ++++++ qiv-2.3.1.tgz -> qiv-2.3.2.tgz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qiv-2.3.1/Changelog new/qiv-2.3.2/Changelog --- old/qiv-2.3.1/Changelog 2013-12-20 01:50:37.000000000 +0100 +++ new/qiv-2.3.2/Changelog 2017-11-03 19:27:27.000000000 +0100 @@ -21,7 +21,7 @@ al: Adrian Lopez <adri...@caribe.net> yf: Y Furuhashi <y_furuha...@ot.olympus.co.jp> wd: Wayne Davison <wa...@opencoder.net> - js: Johannes Stezenbach <j...@convergence.de> + js: Johannes Stezenbach <j...@sig21.net> ok: OEyvind Kolaas <pip...@users.sourceforge.net> mc: Matthieu Castet <castet.matth...@free.fr> jd: Geoffrey T. Dairik <dair...@dairiki.org> @@ -34,6 +34,37 @@ pw: Peter deWachter <pdewa...@gmail.com> ap: Akos Pasztory <akos.paszt...@gmail.com> +2.3.2 +======== + 31.10.2017 [tw] fix: window sometimes recentered, when moved around with mouse + 19.10.2017 [as] fix Makefile for cross-compiling: Make pkg-config substitutable (Debian Bug#879108) + 10.10.2017 [tw] add specfile to build rpm for CentOS + 07.10.2017 [tw] add option --trashbin to use trash bin instead + of .qiv-trash when deleting images + 06.10.2017 [as] add ability (and options) to display JPEG comments + 06.10.2017 [as] more sophisticated exiftool call in qiv-command example + 04.10.2017 [tw] fix inconsistent fixed-zoom behaviour + 10.08.2017 [tw] Don't try to rotate if file is not an image + 06.06.2017 [tw] get rid of some more XID collisions + 30.05.2016 [tw] Fix occasionally erratic behaviour of qiv statusbar + [tw] Fix xpm autodetection with libmagic + 26.05.2016 [tw] Fix small artefacts in pictures which might + happen when running remote over slow link + (patch by Derek Schrock) + 20.05.2016 [tw] update image after it is exposed in window mode + 12.05.2016 [js/tw] fix broken "-no-filter" option + libmagic filter now works on symlinks + 07.11.2015 [tw] fix linking order in "make debug", did not + work in some newer gcc versions + 18.06.2015 [as] turn on EXIF autorotation by default + 13.09.2014 [tw] Add option to sort files by modification time. + (patch by Stefan Rüger) + 23.04.2014 [tw] In case of "watch" option, check image only every 1/10 sec, + instead of every 200us. This was way too short for + devices like RasPi etc. (Hamish) + [tw] Leave jumping mode on invalid input and process input key + as if it was entered in non jumping mode (Sergey Pinaev) + 2.3.1 ===== 25.11.2013 [tw] Add libXext to libraries for linking in Makefile. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qiv-2.3.1/Makefile new/qiv-2.3.2/Makefile --- old/qiv-2.3.1/Makefile 2013-12-20 01:50:37.000000000 +0100 +++ new/qiv-2.3.2/Makefile 2017-11-03 19:27:27.000000000 +0100 @@ -6,8 +6,9 @@ # Directory where qiv will be installed under. PREFIX = /usr/local -# Font to use for statusbar in fullscreen mode +# Fonts to use for statusbar and comments STATUSBAR_FONT = "Monospace 9" +COMMENT_FONT = "Monospace 20" # Cursor to use on qiv windows - see # /usr/X11R6/include/X11/cursorfont.h for more choices. @@ -49,7 +50,11 @@ # Do not edit below here! ###################################################################### -CC = gcc +ifeq ($(origin CC),default) +CC = gcc +endif + +PKG_CONFIG ?= pkg-config #CFLAGS = -O0 -g -Wall CFLAGS = -O2 -Wall \ -fcaller-saves -ffast-math -fno-strength-reduce \ @@ -58,8 +63,8 @@ # -fcaller-saves -ffast-math -fno-strength-reduce \ # -fthread-jumps #-march=pentium #-DSTAT_MACROS_BROKEN -INCLUDES := $(shell pkg-config --cflags gdk-2.0 imlib2) -LIBS := $(shell pkg-config --libs gdk-2.0 imlib2) -lX11 -lXext +INCLUDES := $(shell $(PKG_CONFIG) --cflags gdk-2.0 imlib2) +LIBS := $(shell $(PKG_CONFIG) --libs gdk-2.0 imlib2) -lX11 -lXext -lgio-2.0 # [as] thinks that this is not portable enough: # [lc] I use a virtual screen of 1600x1200, and the resolution is 1024x768, @@ -75,6 +80,7 @@ DEFINES = $(patsubst %,-DEXTN_%, $(EXTNS)) \ $(GETOPT_LONG) \ -DSTATUSBAR_FONT='$(STATUSBAR_FONT)' \ + -DCOMMENT_FONT='$(COMMENT_FONT)' \ -DCENTER=$(CENTER) \ -DFILTER=$(FILTER) \ -DCURSOR=$(CURSOR) \ @@ -88,13 +94,13 @@ endif ifdef LCMS -INCLUDES += $(shell pkg-config --cflags lcms2) -LIBS += $(shell pkg-config --libs lcms2) -ljpeg -ltiff +INCLUDES += $(shell $(PKG_CONFIG) --cflags lcms2) +LIBS += $(shell $(PKG_CONFIG) --libs lcms2) -ljpeg -ltiff endif ifdef EXIF -INCLUDES += $(shell pkg-config --cflags libexif) -LIBS += $(shell pkg-config --libs libexif) +INCLUDES += $(shell $(PKG_CONFIG) --cflags libexif) +LIBS += $(shell $(PKG_CONFIG) --libs libexif) endif ifdef MAGIC @@ -112,7 +118,7 @@ $(PROGRAM): $(OBJS) $(CC) $(CFLAGS) $(DEFINES) $(OBJS) $(LIBS) -o $(PROGRAM) -$(OBJS): %.o: %.c $(HEADERS) +$(OBJS): %.o: %.c $(HEADERS) Makefile $(CC) -c $(CFLAGS) $(DEFINES) $(INCLUDES) $< -o $@ main.o: main.h @@ -122,7 +128,7 @@ debug: $(PROGRAM_G) $(PROGRAM_G): $(OBJS_G) - $(CC) -g $(CFLAGS) $(DEFINES_G) $(LIBS) $(OBJS_G) -o $(PROGRAM_G) + $(CC) -g $(CFLAGS) $(DEFINES_G) $(OBJS_G) $(LIBS) -o $(PROGRAM_G) $(OBJS_G): %.g: %.c $(HEADERS) $(CC) -c -g $(CFLAGS) $(DEFINES_G) $(INCLUDES) $< -o $@ @@ -147,8 +153,8 @@ echo install -d -m 0755 $(PREFIX)/man/man1; \ install -d -m 0755 $(PREFIX)/man/man1; \ fi - install -m 0644 $(PROGRAM).1 $(PREFIX)/man/man1 - $(COMPRESS_PROG) $(PREFIX)/man/man1/$(PROGRAM).1 + install -m 0644 $(PROGRAM).1 $(PREFIX)/share/man/man1 + $(COMPRESS_PROG) $(PREFIX)/share/man/man1/$(PROGRAM).1 @if [ ! -e $(PREFIX)/share/pixmaps ]; then \ echo install -d -m 0755 $(PREFIX)/share/pixmaps; \ install -d -m 0755 $(PREFIX)/share/pixmaps; \ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qiv-2.3.1/Makefile.Solaris new/qiv-2.3.2/Makefile.Solaris --- old/qiv-2.3.1/Makefile.Solaris 2013-12-20 01:50:37.000000000 +0100 +++ new/qiv-2.3.2/Makefile.Solaris 2017-11-03 19:27:27.000000000 +0100 @@ -6,8 +6,9 @@ # Directory where qiv will be installed under. PREFIX = /usr/local -# Font to use for statusbar in fullscreen mode +# Fonts to use for statusbar and comments STATUSBAR_FONT = "fixed" +COMMENT_FONT = "fixed" # Cursor to use on qiv windows - see # /usr/X11R6/include/X11/cursorfont.h for more choices. @@ -51,13 +52,16 @@ # Do not edit below here! ###################################################################### -CC = gcc +ifeq ($(origin CC),default) +CC = gcc +endif + CFLAGS = -O2 -Wall -fomit-frame-pointer -finline-functions \ -fcaller-saves -ffast-math -fno-strength-reduce \ -fthread-jumps #-march=pentium #-DSTAT_MACROS_BROKEN INCLUDES := $(shell pkg-config --cflags gdk-2.0 imlib2) -LIBS := $(shell pkg-config --libs gdk-2.0 imlib2) -lX11 lXext +LIBS := $(shell pkg-config --libs gdk-2.0 imlib2) -lX11 lXext -lgio-2.0 # [as] thinks that this is not portable enough: # [lc] I use a virtual screen of 1600x1200, and the resolution is 1024x768, @@ -73,6 +77,7 @@ DEFINES = $(patsubst %,-DEXTN_%, $(EXTNS)) \ $(GETOPT_LONG) \ -DSTATUSBAR_FONT='$(STATUSBAR_FONT)' \ + -DCOMMENT_FONT='$(COMMENT_FONT)' \ -DCENTER=$(CENTER) \ -DFILTER=$(FILTER) \ -DCURSOR=$(CURSOR) \ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qiv-2.3.1/contrib/exiftool.grep-exclude-pattern.for.qiv-command new/qiv-2.3.2/contrib/exiftool.grep-exclude-pattern.for.qiv-command --- old/qiv-2.3.1/contrib/exiftool.grep-exclude-pattern.for.qiv-command 1970-01-01 01:00:00.000000000 +0100 +++ new/qiv-2.3.2/contrib/exiftool.grep-exclude-pattern.for.qiv-command 2017-11-03 19:27:27.000000000 +0100 @@ -0,0 +1,27 @@ +^Digital Zoom : None +^Digital Zoom Ratio : 1 +^Flash : Off, Did not fire +^Canon Flash Mode : Off +^Self Timer : Off +^Orientation : Horizontal (normal) +^Categories : (none) +^Faces Detected : 0 +^Shot Number In Continuous Burst : 1 +^Macro Mode : Normal +^Metering Mode : Unknown +^Exposure Program : Not Defined +^Fisheye Filter : Off +^ND Filter : Off +^Grainy B/W Filter : Off +^Soft Focus Filter : Off +^Toy Camera Filter : Off +^Miniature Filter : Off +^Miniature Filter Orientation : Unknown +^Miniature Filter Position : -1 +^Miniature Filter Parameter : -1 +^Painting Filter : Off +^Watercolor Filter : Off +^Control Mode : Camera Local Control +^Auto Exposure Bracketing : Off +^AEB Bracket Value : 0 +^Focal Length In 35mm Format : 0 mm diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qiv-2.3.1/contrib/exiftool.tags.for.qiv-command new/qiv-2.3.2/contrib/exiftool.tags.for.qiv-command --- old/qiv-2.3.1/contrib/exiftool.tags.for.qiv-command 1970-01-01 01:00:00.000000000 +0100 +++ new/qiv-2.3.2/contrib/exiftool.tags.for.qiv-command 2017-11-03 19:27:27.000000000 +0100 @@ -0,0 +1,61 @@ +-Comment +-Make +-Model +-Copyright +-Artist +-DateTimeOriginal +-ModifyDate +-CreateDate +-CameraTemperature +-FileNumber +-ImageSize +-Aperture +-ExposureTime +-ISO +-LightValue +-FocalLength35efl +-FocalLength35mm +-FocalLengthIn35mmFormat +-Lens35efl +-DigitalZoom +-DigitalZoomRatio +-FOV +-DOF +-HyperfocalDistance +-FocalLengthTeleZoom +-FocusDistance +-FocusDistanceLower +-FocusDistanceUpper +-AFAreaMode +-AFPoint +-NumAFPoints +-ImageStabilization +-Flash +-CanonFlashMode +-SelfTimer +-Orientation +-Categories +-FacesDetected +-ExposureProgram +-CanonExposureMode +-ShootingMode +-EasyMode +-SequenceNumber +-MacroMode +-FocusMode +-MeteringMode +-SpotMeteringMode +-*Filter* +-BurstShot +-BurstSpeed +-Software +-CreatorTool +-GPSPosition +-GPSAltitude +-GPSDateTime +-GPSStatus +-ControlMode +-AutoExposureBracketing +-AEBBracketValue +-ICCProfileName +-EncodingProcess diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qiv-2.3.1/contrib/qiv-command.example new/qiv-2.3.2/contrib/qiv-command.example --- old/qiv-2.3.1/contrib/qiv-command.example 2013-12-20 01:50:37.000000000 +0100 +++ new/qiv-2.3.2/contrib/qiv-command.example 2017-11-03 19:27:27.000000000 +0100 @@ -52,9 +52,9 @@ # exiftool "$filename" # jhead "$filename" # more sophisticated for better infos (adjust paths!) -# if [ -r $HOME/local/var/exiftool.grep-pattern.for.qiv-command ]; then -# exiftool "$filename" | grep -f $HOME/local/var/exiftool.grep-pattern.for.qiv-command \ -# | grep -v 'Orientation : Horizontal (normal)' +# if [ -r $HOME/local/var/exiftool.tags.for.qiv-command ]; then +# exiftool `xargs < $HOME/local/var/exiftool.tags.for.qiv-command` "$filename" \ +# | grep -v -f $HOME/local/var/exiftool.grep-exclude-pattern.for.qiv-command # jhead -nofinfo "$filename" | grep -i -E '^(JPEG Quality |Caption )' # else # jhead -nofinfo "$filename" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qiv-2.3.1/contrib/qiv.spec new/qiv-2.3.2/contrib/qiv.spec --- old/qiv-2.3.1/contrib/qiv.spec 1970-01-01 01:00:00.000000000 +0100 +++ new/qiv-2.3.2/contrib/qiv.spec 2017-11-03 19:27:27.000000000 +0100 @@ -0,0 +1,104 @@ +# Should work on most rpm based distros. Package names might differ here and there. +# Tested on RHEL6/CentOS6, make sure epel repository is enabled. +Name: qiv +Version: 2.3.2 +Release: 1 +Summary: A quick image viewer for X +Source0: http://spiegl.de/qiv/download/%{name}-%{version}.tar.gz +License: GPL +Url: http://spiegl.de/qiv/ + +BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot + +BuildRequires: gtk2-devel +BuildRequires: libexif-devel +BuildRequires: imlib2-devel +BuildRequires: file-devel +BuildRequires: pkgconfig +BuildRequires: lcms2-devel +BuildRequires: libtiff-devel +# This has most likely to be another jpeg package on distros other than RHEL/CentOS +BuildRequires: libjpeg-turbo-devel + +Requires: gtk2 +Requires: libexif +Requires: imlib2 +Requires: file +Requires: lcms2 + +Group: Graphics + +%description +Quick Image Viewer (qiv) is a very small and pretty fast GDK2.0/Imlib2 image +viewer. Features include zoom, maxpect, scale down, fullscreen, +brightness/contrast/gamma correction, slideshow, pan with keyboard and mouse, +rotate left/right, flip, delete (move to .qiv-trash/), jump to image x, jump +forward/backward x images, filename filter, and you can use qiv to set your +X11-Desktop background. With multi monitor support. + +qiv also supports the assignment of external commands (like metacam) to unused +keys. + +%prep +%setup -q -n %{name}-%{version} + +%build +echo RPM_BUILD_ROOT ist $RPM_BUILD_ROOT +echo pwd ist +pwd +make CFLAGS="$RPM_OPT_FLAGS" + +%install +echo pwd ist +pwd +mkdir -p $RPM_BUILD_ROOT%{_bindir} +mkdir -p $RPM_BUILD_ROOT/{%{_bindir},%{_mandir}/man1} + +DISPLAY="" make PREFIX=$RPM_BUILD_ROOT%{_prefix} install +# Hmm. Any better ideas how to achieve this? +mkdir -p %{_builddir}/%{name}-%{version}/examples/ +cp -p %{_builddir}/%{name}-%{version}/contrib/gps2url.py %{_builddir}/%{name}-%{version}/examples +cp -p %{_builddir}/%{name}-%{version}/contrib/qiv-command.example %{_builddir}/%{name}-%{version}/examples/qiv-command + +%clean +rm -rf $RPM_BUILD_ROOT + +%files +%defattr(-,root,root) +%doc README Changelog README.COPYING README.INSTALL intro.jpg examples +%{_bindir}/qiv +%{_mandir}/man1/qiv.1* +%{_prefix}/share/applications/qiv.desktop +%{_prefix}/share/pixmaps/qiv.png + +%changelog +* Thu Oct 10 2017 Thomas Wiegner <wieg...@gmx.de> 2.3.2 +- qiv changes since v2.3.1: + + [tw] fix: window sometimes recentered, when moved around with mouse + + [as] fix Makefile for cross-compiling: Make pkg-config substitutable (Debian Bug#879108) + + [tw] add specfile to build rpm for CentOS + + [tw] add option --trashbin to use trash bin instead + of .qiv-trash when deleting images + + [as] add ability (and options) to display JPEG comments + + [as] more sophisticated exiftool call in qiv-command example + + [tw] fix inconsistent fixed-zoom behaviour + + [tw] Don't try to rotate if file is not an image + + [tw] get rid of some more XID collisions + + [tw] Fix occasionally erratic behaviour of qiv statusbar + + [tw] Fix xpm autodetection with libmagic + + [tw] Fix small artefacts in pictures which might happen when + running remote over slow link (patch by Derek Schrock) + + [tw] update image after it is exposed in window mode + + [js/tw] fix broken "-no-filter" option + libmagic filter now works on symlinks + + [tw] fix linking order in "make debug", did not + work in some newer gcc versions + + [as] turn on EXIF autorotation by default + + [tw] Add option to sort files by modification time. + (patch by Stefan Rüger) + + [tw] In case of "watch" option, check image only every 1/10 sec, + instead of every 200us. This was way too short for + devices like RasPi etc. (Hamish) + + [tw] Leave jumping mode on invalid input and process input key + as if it was entered in non jumping mode (Sergey Pinaev) + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qiv-2.3.1/debian/changelog new/qiv-2.3.2/debian/changelog --- old/qiv-2.3.1/debian/changelog 2013-12-20 01:50:37.000000000 +0100 +++ new/qiv-2.3.2/debian/changelog 2017-11-03 19:27:27.000000000 +0100 @@ -1,3 +1,9 @@ +qiv (2.3.2) stable; urgency=low + + * new upstream version; see Changelog for details + + -- Andy Spiegl <debian.a...@spiegl.de> Fri, 03 Nov 2017 19:00:38 +0100 + qiv (2.3.1) stable; urgency=low * new upstream version; see Changelog for details diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qiv-2.3.1/debian/rules new/qiv-2.3.2/debian/rules --- old/qiv-2.3.1/debian/rules 2013-12-20 01:50:37.000000000 +0100 +++ new/qiv-2.3.2/debian/rules 2017-11-03 19:27:27.000000000 +0100 @@ -7,6 +7,8 @@ include /usr/share/cdbs/1/rules/debhelper.mk include /usr/share/cdbs/1/rules/simple-patchsys.mk +DEB_MAKE_EXTRA_ARGS += 'CC=$(CC)' + update-config:: [ -f qiv-command ] || mv contrib/qiv-command.example qiv-command [ -f gps2url.py ] || mv contrib/gps2url.py gps2url.py diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qiv-2.3.1/event.c new/qiv-2.3.2/event.c --- old/qiv-2.3.1/event.c 2013-12-20 01:50:37.000000000 +0100 +++ new/qiv-2.3.2/event.c 2017-11-03 19:27:27.000000000 +0100 @@ -152,7 +152,7 @@ /* Display Push Any Key... message */ pango_layout_set_text(layout, continue_msg, -1); pango_layout_get_pixel_size (layout, &temp, NULL); - gdk_draw_layout (q->win, q->text_gc, + gdk_draw_layout (q->win, q->text_gc, x + width/2 - temp/2, y + height/2 - text_h/2 - descent + (i+1) * (ascent + descent), layout); @@ -179,7 +179,7 @@ // (because the user might have moved the window our since last redraw) if (!fullscreen) { gdk_window_get_position(q->win, &q->win_x, &q->win_y); -// g_print("position : q->win_x = %d, q->win_y = %d, q->win_w = %d, mon = %d\n", q->win_x, q->win_y, q->win_w,q->mon_id); +// g_print("position : q->win_x = %d, q->win_y = %d, q->win_w = %d, mon = %d, typ = %d\n", q->win_x, q->win_y, q->win_w,q->mon_id,ev->type); } q->mon_id = gdk_screen_get_monitor_at_window(screen, q->win); @@ -190,13 +190,21 @@ case GDK_EXPOSE: if (!q->exposed) { - q->exposed = 1; qiv_set_cursor_timeout(q); - } - if(fullscreen) { if(center) center_image(q); + } + if(fullscreen) + { update_image(q, FULL_REDRAW); } + else + { + if(q->exposed) + update_image(q, MIN_REDRAW); + else + update_image(q, FULL_REDRAW); + } + q->exposed = 1; break; case GDK_LEAVE_NOTIFY: @@ -223,26 +231,6 @@ // printf("GDK_CONFIGURE get_root_origin %d %d\n", // magnify_img.frame_x, magnify_img.frame_y); } - // gdk_draw_rectangle(q->win, q->status_gc, 1, 10, 10, 50, 50); - if (statusbar_window && !fullscreen) { -#ifdef DEBUG - g_print("*** print statusbar at (%d, %d)\n", MAX(2,q->win_w-q->text_w-10), MAX(2,q->win_h-q->text_h-10)); -#endif - // printf(">>> statusbar_w %d %d %d %d\n", - // MAX(2,q->win_w-text_w-10), MAX(2,q->win_h-text_h-10), text_w+5, text_h+5); - - gdk_draw_rectangle(q->win, q->bg_gc, 0, - MAX(2,q->win_w-q->text_w-10), MAX(2,q->win_h-q->text_h-10), - q->text_w+5, q->text_h+5); - gdk_draw_rectangle(q->win, q->status_gc, 1, - MAX(3,q->win_w-q->text_w-9), MAX(3,q->win_h-q->text_h-9), - q->text_w+4, q->text_h+4); - - pango_layout_set_text(layout, q->win_title, -1); - pango_layout_get_pixel_size (layout, &(q->text_w), &(q->text_h)); - gdk_draw_layout (q->win, q->text_gc, MAX(5,q->win_w-q->text_w-7), MAX(5,q->win_h-7-q->text_h), layout); - } - break; case GDK_BUTTON_PRESS: @@ -418,9 +406,9 @@ jcmd[jidx] = '\0'; if (jumping) { jump2image(jcmd); - qiv_load_image(q); - jumping=0; - } + qiv_load_image(q); + jumping=0; + } else { // extcommand=1 int numlines = 0; const char **lines; @@ -436,6 +424,23 @@ } /* else record keystroke if not null */ else if(ev->key.string && *(ev->key.string) != '\0') { + if (jumping) { + /* leave jumping mode on invalid input and process + * input key as if it entered in non jumping mode */ + if((jidx == 0 && + (*(ev->key.string) != 'f' && + *(ev->key.string) != 'F' && + *(ev->key.string) != 'b' && + *(ev->key.string) != 'B' && + *(ev->key.string) != 't' && + *(ev->key.string) != 'T')) || + (jidx > 0 && + (*(ev->key.string) < '0' || *(ev->key.string) > '9'))) { + jumping = 0; + qiv_handle_event(ev, data); + return; + } + } jcmd[jidx++]=*(ev->key.string); jcmd[jidx] = '\0'; if (extcommand) @@ -581,12 +586,22 @@ update_image(q, MIN_REDRAW); break; + /* jpeg comments on/off */ + + case 'J': + exit_slideshow = FALSE; + comment_window ^= 1; + snprintf(infotext, sizeof infotext, comment_window ? + "(Comments: on)" : "(Comments: off)"); + update_image(q, MIN_REDRAW); + break; + /* Slide show on/off */ case 's': exit_slideshow = FALSE; slide ^= 1; - if (slide) + if (slide) { dpms_disable(); } @@ -852,19 +867,26 @@ case GDK_KEY_Delete: case 'd': + { + int ret; if (!readonly) { - if (move2trash() == 0) + if (trashbin == 1) + ret = move2trashbin(); + else + ret = move2trash(); + + if (ret == 0) snprintf(infotext, sizeof infotext, "(Deleted last image)"); else snprintf(infotext, sizeof infotext, "(Delete FAILED)"); qiv_load_image(q); } break; + } /* Undelete image */ - case 'u': - if (!readonly) { + if (!readonly && !trashbin) { if (undelete_image() == 0) snprintf(infotext, sizeof infotext, "(Undeleted)"); else @@ -872,7 +894,6 @@ qiv_load_image(q); } break; - /* Copy image to selected directory */ case 'a': @@ -913,9 +934,10 @@ watch_file ^= 1; snprintf(infotext, sizeof infotext, watch_file ? "(File watching: on)" : "(File watching: off)"); - update_image(q, REDRAW); + update_image(q, MIN_REDRAW); if(watch_file){ - g_idle_add (qiv_watch_file, q); + // check every 100ms + g_timeout_add_full(G_PRIORITY_DEFAULT_IDLE, 100, qiv_watch_file, q, NULL); } break; @@ -949,7 +971,7 @@ to_root=1; set_desktop_image(q); snprintf(infotext, sizeof infotext, "(Centered image on background)"); - update_image(q, REDRAW); + update_image(q, MIN_REDRAW); to_root=0; break; @@ -959,7 +981,7 @@ to_root_t=1; set_desktop_image(q); snprintf(infotext, sizeof infotext, "(Tiled image on background)"); - update_image(q, REDRAW); + update_image(q, MIN_REDRAW); to_root_t=0; break; @@ -967,7 +989,7 @@ to_root_s=1; set_desktop_image(q); snprintf(infotext, sizeof infotext, "(Stretched image on background)"); - update_image(q, REDRAW); + update_image(q, MIN_REDRAW); to_root_s=0; break; @@ -1016,7 +1038,7 @@ } break; case ',': - if(fullscreen) + if(fullscreen) { disable_grab ^= 1; snprintf(infotext, sizeof infotext, "(grab %s)", (disable_grab ? "off" : "on")); @@ -1070,7 +1092,6 @@ #endif case 'F': case 'H': - case 'J': case 'K': case 'L': case 'M': diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qiv-2.3.1/image.c new/qiv-2.3.2/image.c --- old/qiv-2.3.1/image.c 2013-12-20 01:50:37.000000000 +0100 +++ new/qiv-2.3.2/image.c 2017-11-03 19:27:27.000000000 +0100 @@ -203,6 +203,7 @@ Imlib_Image * im=NULL; int has_alpha=0, rot; + q->exposed=0; gettimeofday(&load_before, 0); if (imlib_context_get_image()) @@ -234,37 +235,36 @@ q->error = 0; q->orig_w = imlib_image_get_width(); q->orig_h = imlib_image_get_height(); - } - - if (rotation > 10) { - /* conditional rotation -- apply rotation only if image fits better */ - int screen_is_wide = monitor[q->mon_id].width > monitor[q->mon_id].height; - int image_is_wide = q->orig_w > q->orig_h; - int does_not_fit = q->orig_w > monitor[q->mon_id].width || q->orig_h > monitor[q->mon_id].height; - if (screen_is_wide != image_is_wide && does_not_fit) - rot = rotation - 10; /* we want the rotation (will be 11 -> 1 or 13 -> 3) */ - else - rot = 0; /* don't rotate */ - } else - rot = rotation; - if (rot) { - imlib_image_orientate(rot); - if (rot != 2) { - swap(&q->orig_w, &q->orig_h); - swap(&q->win_w, &q->win_h); + if (rotation > 10) { + /* conditional rotation -- apply rotation only if image fits better */ + int screen_is_wide = monitor[q->mon_id].width > monitor[q->mon_id].height; + int image_is_wide = q->orig_w > q->orig_h; + int does_not_fit = q->orig_w > monitor[q->mon_id].width || q->orig_h > monitor[q->mon_id].height; + if (screen_is_wide != image_is_wide && does_not_fit) + rot = rotation - 10; /* we want the rotation (will be 11 -> 1 or 13 -> 3) */ + else + rot = 0; /* don't rotate */ + } else + rot = rotation; + + if (rot) { + imlib_image_orientate(rot); + if (rot != 2) { + swap(&q->orig_w, &q->orig_h); + swap(&q->win_w, &q->win_h); + } } - } + if (rot && rot != 2) + correct_image_position(q); - if (rot && rot != 2) - correct_image_position(q); + } if (first) { setup_win(q); - first = 0; } - + check_size(q, TRUE); /* desktop-background -> exit */ @@ -366,7 +366,7 @@ gdk_window_resize(q->win, q->win_w, q->win_h); } if (!(to_root || to_root_t || to_root_s)) - gdk_window_show(q->win); + gdk_window_lower(q->win); } else { /* fullscreen */ @@ -407,8 +407,10 @@ q->bg_gc = gdk_gc_new(q->win); q->text_gc = gdk_gc_new(q->win); /* black is default */ q->status_gc = gdk_gc_new(q->win); + q->comment_gc = gdk_gc_new(q->win); gdk_gc_set_foreground(q->bg_gc, &image_bg); gdk_gc_set_foreground(q->status_gc, &text_bg); + gdk_gc_set_foreground(q->comment_gc, &comment_bg); setup_imlib_for_drawable(GDK_DRAWABLE(q->win)); } @@ -645,9 +647,6 @@ q->win_w = fixed_window_size; q->win_h = q->orig_h * w_o_ratio; } else { - if (fixed_zoom_factor) { - zoom_factor = fixed_zoom_factor; /* reset zoom */ - } q->win_w = (gint)(q->orig_w * (1 + zoom_factor * 0.1)); q->win_h = (gint)(q->orig_h * (1 + zoom_factor * 0.1)); } @@ -721,6 +720,7 @@ { if(mode != MIN_REDRAW) { + GdkPixmap * pix_ptr = NULL; if (q->p) { imlib_free_pixmap_and_mask(GDK_PIXMAP_XID(q->p)); g_object_unref(q->p); @@ -734,11 +734,18 @@ elapsed = ((after.tv_sec + after.tv_usec / 1.0e6) - (before.tv_sec + before.tv_usec / 1.0e6)); - /*TODO: Hier gibt es XID collision, wenn am Bild eigentlich nix geändert wurde*/ - q->p = gdk_pixmap_foreign_new_for_screen(screen, x_pixmap, q->win_w, q->win_h, 24); + pix_ptr = gdk_pixmap_lookup (x_pixmap); + if(pix_ptr == NULL) + { + q->p = gdk_pixmap_foreign_new_for_screen(screen, x_pixmap, q->win_w, q->win_h, 24); + } + else + { + q->p = pix_ptr; + g_object_ref(q->p); + } gdk_drawable_set_colormap(GDK_DRAWABLE(q->p), gdk_drawable_get_colormap(GDK_DRAWABLE(q->win))); -// m = x_mask == None ? NULL : gdk_pixmap_foreign_new(x_mask); m = x_mask == None ? NULL : gdk_pixmap_foreign_new_for_screen(screen, x_mask, q->win_w, q->win_h, 1); } @@ -756,11 +763,16 @@ } gdk_window_set_title(q->win, q->win_title); - + q->text_len = strlen(q->win_title); pango_layout_set_text(layout, q->win_title, -1); pango_layout_get_pixel_size (layout, &(q->text_w), &(q->text_h)); + if(comment && comment_window) { + pango_layout_set_text(layoutComment, comment, -1); + pango_layout_get_pixel_size (layoutComment, &(q->comment_w), &(q->comment_h)); + } + if (!fullscreen) { GdkGeometry geometry = { .min_width = q->win_w, @@ -771,7 +783,15 @@ }; gdk_window_set_geometry_hints(q->win, &geometry, GDK_HINT_MIN_SIZE | GDK_HINT_MAX_SIZE | GDK_HINT_WIN_GRAVITY); - gdk_window_move_resize(q->win, q->win_x, q->win_y, q->win_w, q->win_h); + + if(first) { + gdk_window_show(q->win); + first = 0; + q->exposed=0; + } + + if(mode != MIN_REDRAW) + gdk_window_move_resize(q->win, q->win_x, q->win_y, q->win_w, q->win_h); if (!q->error) { gdk_window_set_back_pixmap(q->win, q->p, FALSE); @@ -791,6 +811,35 @@ } } gdk_window_clear(q->win); + + if(statusbar_window) + { +#ifdef DEBUG + g_print("*** print statusbar at (%d, %d)\n", MAX(2,q->win_w-q->text_w-10), MAX(2,q->win_h-q->text_h-10)); +#endif + gdk_draw_rectangle(q->win, q->bg_gc, 0, + MAX(2,q->win_w-q->text_w-10), MAX(2,q->win_h-q->text_h-10), + q->text_w+5, q->text_h+5); + gdk_draw_rectangle(q->win, q->status_gc, 1, + MAX(3,q->win_w-q->text_w-9), MAX(3,q->win_h-q->text_h-9), + q->text_w+4, q->text_h+4); + + gdk_draw_layout (q->win, q->text_gc, MAX(5,q->win_w-q->text_w-7), MAX(5,q->win_h-7-q->text_h), layout); + } + + if(comment && comment_window) { + /* draw comment */ + gdk_draw_rectangle(q->win, q->bg_gc, 0, + 25, MAX(5,q->win_h-q->comment_h-30), + q->comment_w+5, q->comment_h+5); + + gdk_draw_rectangle(q->win, q->comment_gc, 1, + 26, MAX(6,q->win_h-q->comment_h-29), + q->comment_w+4, q->comment_h+4); + + gdk_draw_layout (q->win, q->text_gc, 27, MAX(5,q->win_h - 27 - q->comment_h), layoutComment); + } + } // if (!fullscreen) else { @@ -838,10 +887,7 @@ gdk_draw_drawable(q->win, q->bg_gc, q->p, 0, 0, q->win_x, q->win_y, q->win_w, q->win_h); - if (statusbar_fullscreen) { - { - gdk_draw_rectangle(q->win, q->bg_gc, 0, statusbar_x-q->text_w-10, statusbar_y-q->text_h-10, q->text_w+5, q->text_h+5); @@ -849,7 +895,19 @@ statusbar_x-q->text_w-9, statusbar_y-q->text_h-9, q->text_w+4, q->text_h+4); gdk_draw_layout (q->win, q->text_gc, statusbar_x-q->text_w-7, statusbar_y-7-q->text_h, layout); - } + } + + if(comment && comment_window) { + /* draw comment */ + gdk_draw_rectangle(q->win, q->bg_gc, 0, + 25, statusbar_y - q->comment_h - 30, + q->comment_w + 5, q->comment_h + 5); + + gdk_draw_rectangle(q->win, q->comment_gc, 1, + 26, statusbar_y - q->comment_h - 29, + q->comment_w + 4, q->comment_h + 4); + + gdk_draw_layout (q->win, q->text_gc, 27, statusbar_y - 27 - q->comment_h, layoutComment); } q->win_ox = q->win_x; @@ -859,6 +917,12 @@ q->text_ow = q->text_w; q->text_oh = q->text_h; q->statusbar_was_on = statusbar_fullscreen; + + if(first) { + gdk_window_show(q->win); + first = 0; + } + gdk_window_move_resize(q->win, monitor[q->mon_id].x, monitor[q->mon_id].y, monitor[q->mon_id].width, monitor[q->mon_id].height); } @@ -883,12 +947,14 @@ if (q->bg_gc) g_object_unref(q->bg_gc); if (q->text_gc) g_object_unref(q->text_gc); if (q->status_gc) g_object_unref(q->status_gc); + if (q->comment_gc) g_object_unref(q->comment_gc); q->p=NULL; q->win=NULL; q->bg_gc=NULL; q->text_gc=NULL; q->status_gc=NULL; + q->comment_gc=NULL; } void setup_magnify(qiv_image *q, qiv_mgl *m) Binary files old/qiv-2.3.1/intro.jpg and new/qiv-2.3.2/intro.jpg differ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qiv-2.3.1/main.c new/qiv-2.3.2/main.c --- old/qiv-2.3.1/main.c 2013-12-20 01:50:37.000000000 +0100 +++ new/qiv-2.3.2/main.c 2017-11-03 19:27:27.000000000 +0100 @@ -84,7 +84,7 @@ g_print("qiv: cannot create source color profile.\n"); usage(argv[0],1); } - + if (display_profile) { h_display_profile = cmsOpenProfileFromFile(display_profile, "r"); } else { @@ -125,14 +125,14 @@ { gdk_screen_get_monitor_geometry(screen, i, &monitor[i]); } - + if(user_screen < num_monitors) { main_img.mon_id = user_screen; } /* statusbar with pango */ - layout = pango_layout_new(gdk_pango_context_get()); + layout = pango_layout_new(gdk_pango_context_get()); fontdesc = pango_font_description_from_string (STATUSBAR_FONT); /* set fontsize to 8 if no fontsize is given */ @@ -141,7 +141,19 @@ pango_font_description_set_size(fontdesc, PANGO_SCALE * STATUSBAR_FS); } metrics = pango_context_get_metrics (gdk_pango_context_get(), fontdesc, NULL); - pango_layout_set_font_description (layout, fontdesc); + pango_layout_set_font_description (layout, fontdesc); + + /* jpeg comment with pango */ + layoutComment = pango_layout_new(gdk_pango_context_get()); + fontdescComment = pango_font_description_from_string (COMMENT_FONT); + + /* set fontsize to 8 if no fontsize is given */ + if(!pango_font_description_get_size(fontdescComment)) + { + pango_font_description_set_size(fontdescComment, PANGO_SCALE * COMMENT_FS); + } + metricsComment = pango_context_get_metrics (gdk_pango_context_get(), fontdescComment, NULL); + pango_layout_set_font_description (layoutComment, fontdescComment); max_rand_num = images; @@ -154,6 +166,7 @@ color_alloc(STATUSBAR_BG, &text_bg); color_alloc(ERROR_BG, &error_bg); + color_alloc(COMMENT_BG, &comment_bg); color_alloc(image_bg_spec, &image_bg); /* Display first image first, except in random mode */ @@ -192,7 +205,7 @@ qiv_load_image(&main_img); if(watch_file){ - g_idle_add (qiv_watch_file, &main_img); + g_timeout_add_full(G_PRIORITY_DEFAULT_IDLE, 100, qiv_watch_file, &main_img, NULL); } g_main_run(qiv_main_loop); /* will never return */ @@ -272,7 +285,7 @@ #ifdef HAVE_MAGIC magic_t cookie; - cookie = magic_open(MAGIC_NONE); + cookie = magic_open(MAGIC_SYMLINK); magic_load(cookie,NULL); #endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qiv-2.3.1/main.h new/qiv-2.3.2/main.h --- old/qiv-2.3.1/main.h 2013-12-20 01:50:37.000000000 +0100 +++ new/qiv-2.3.2/main.h 2017-11-03 19:27:27.000000000 +0100 @@ -12,8 +12,9 @@ GdkColormap *cmap; /* global colormap */ char *image_bg_spec = IMAGE_BG; GdkColor image_bg; /* default background */ -GdkColor text_bg; /* statusbar and help backgrounf */ +GdkColor text_bg; /* statusbar and help background */ GdkColor error_bg; /* for the error window/screen */ +GdkColor comment_bg; /* comment background */ int images; /* Number of images in current collection */ char **image_names = NULL; /* Filenames of the images */ int image_idx = 0; /* Index of current image displayed. 0 = 1st image */ @@ -22,7 +23,7 @@ qiv_deletedfile *deleted_files; int delete_idx; char select_dir[FILENAME_LEN]; -char *comment=NULL; +char *comment=NULL; gint jpeg_prog=0; off_t file_size; @@ -30,6 +31,9 @@ PangoLayout *layout; PangoFontMetrics *metrics; PangoFontDescription *fontdesc; +PangoLayout *layoutComment; +PangoFontMetrics *metricsComment; +PangoFontDescription *fontdescComment; /* Options and such */ @@ -47,6 +51,7 @@ int maxpect; /* TRUE if autozoom (fit-to-screen) mode */ int statusbar_fullscreen = 1; /* TRUE if statusbar in fullscreen is turned on (default) */ int statusbar_window = 0; /* FALSE if statusbar in window is turned off (default) */ +int comment_window = 0; /* FALSE if comment in window is turned off (default) */ int slide; /* 1=slide show running */ int scale_down; /* resize down if image x/y > screen */ int recursive; /* descend recursively */ @@ -65,9 +70,10 @@ int magnify = 0; /* [lc] */ int user_screen = 0; /* preferred (by user) monitor */ int browse = 0; /* scan directory of file for browsing */ -int autorotate = 0; /* autorotate JPEGs according to EXIF tag */ +int autorotate = 1; /* autorotate JPEGs according to EXIF tag */ int rotation = 0; /* rotation x degrees clockwise, 1=90degrees 2=180degrees 3=270degrees */ int vikeys = 0; /* option to give us some vi-like keys (for movement) */ +int trashbin = 0; /* option to use users trash bin instead of local .qiv_trash when deleting image */ #ifdef SUPPORT_LCMS const char* source_profile = NULL; @@ -96,7 +102,7 @@ "?/F1 show keys (in fullscreen mode)", "F11/F12 in/decrease slideshow delay (1 second)", "a/A copy current image to .qiv-select", - "d/D/del move picture to .qiv-trash", + "d/D/del move picture to .qiv-trash (to trash bin with --trashbin option)", "u undelete the previously trashed image", "+/=/wheel r/btn fwd zoom in (10%)", "-/wheel l/btn back zoom out (10%)", @@ -127,6 +133,7 @@ "E display Exif information", #endif "i statusbar on/off", + "J JPEG comments on/off", "I iconify window", "w watch file on/off", "x center image on background", diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qiv-2.3.1/options.c new/qiv-2.3.2/options.c --- old/qiv-2.3.1/options.c 2013-12-20 01:50:37.000000000 +0100 +++ new/qiv-2.3.2/options.c 2017-11-03 19:27:27.000000000 +0100 @@ -23,9 +23,11 @@ extern char *optarg; extern int optind, opterr, optopt; -#define LONGOPT_VIKEYS 128 +/* put longopt-only options to non ascii values */ +#define LONGOPT_VIKEYS 256 +#define LONGOPT_TRASHBIN 257 -static char *short_options = "ab:c:Cd:efg:hilLmno:pq:rstuvw:xyzA:BDF:GIMNPRSTW:X:Y:Z:"; +static char *short_options = "ab:c:Cd:efg:hilLmno:pq:rstuvw:xyzA:BDF:GIJKMNPRSTW:X:Y:Z:"; static struct option long_options[] = { {"do_grab", 0, NULL, 'a'}, @@ -62,6 +64,8 @@ {"file", 1, NULL, 'F'}, {"disable_grab", 0, NULL, 'G'}, {"statusbar", 0, NULL, 'I'}, + {"showJPEGcomments", 0, NULL, 'J'}, + {"mtime_sort", 0, NULL, 'K'}, {"merged_case_sort", 0, NULL, 'M'}, {"numeric_sort", 0, NULL, 'N'}, {"ignore_path_sort", 0, NULL, 'P'}, @@ -74,11 +78,12 @@ {"source_profile", 1, NULL, 'Y'}, {"display_profile", 1, NULL, 'Z'}, #endif + {"trashbin", 0, NULL, LONGOPT_TRASHBIN}, {"vikeys", 0, NULL, LONGOPT_VIKEYS}, {0, 0, NULL, 0} }; -static int numeric_sort = 0, merged_case_sort = 0, ignore_path_sort = 0; +static int mtime_sort = 0, numeric_sort = 0, merged_case_sort = 0, ignore_path_sort = 0; /* This array makes it easy to sort filenames into merged-case order * (e.g. AaBbCcDdEeFf...). */ @@ -117,6 +122,17 @@ 0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF }; + +static time_t get_mtime(unsigned char *fn) { + struct stat attrib; + + if(stat((char *) fn, &attrib) == 0) + return attrib.st_mtime; + + return 0; +} + + static int my_strcmp(const void *v1, const void *v2) { unsigned char *cp1 = *(unsigned char **)v1; @@ -129,6 +145,15 @@ sufptr2 = cp2 + strlen((char *)cp2); while (--sufptr2 > cp2 && *sufptr2 != '.') {} + if(mtime_sort) { + time_t diff = get_mtime(cp1) - get_mtime(cp2); + if(diff < 0) + return -1; + if(diff > 0) + return 1; + // fall through in case of same time stamp + } + if (ignore_path_sort) { unsigned char *slash; if ((slash = (unsigned char *)strrchr((char *)cp1, '/')) != NULL) @@ -244,7 +269,7 @@ case 'i': force_statusbar=0; break; #if GDK_PIXBUF_MINOR >= 12 - case 'l': autorotate=1; + case 'l': autorotate=0; /* turn autorotation OFF, default is ON */ break; #endif case 'm': maxpect=1; @@ -297,6 +322,10 @@ break; case 'I': force_statusbar=1; break; + case 'J': comment_window=1; + break; + case 'K': mtime_sort = 1; + break; case 'M': merged_case_sort = 1; break; case 'N': numeric_sort = 1; @@ -305,11 +334,11 @@ break; case 'R': readonly=1; break; - case 'S': shuffle=1;need_sort=0; + case 'S': shuffle=1; need_sort=0; break; case 'T': watch_file=1; break; - case 'W': fixed_zoom_factor = (checked_atoi(optarg) - 100) / 10; + case 'W': fixed_zoom_factor = (checked_atoi(optarg) - 100) / 10; zoom_factor = fixed_zoom_factor; break; case 'X': user_screen = checked_atoi(optarg); // g_print("set xinerama screen: %i\n", user_screen); @@ -322,6 +351,9 @@ cms_transform = 1; break; #endif + case LONGOPT_TRASHBIN: + trashbin=1; + break; case LONGOPT_VIKEYS: vikeys=1; break; case 0: @@ -330,8 +362,8 @@ } } - /* In case user specified -D and -P, -M, or -N */ - need_sort = need_sort | ignore_path_sort | merged_case_sort | numeric_sort; + /* In case user specified -D and -K, -P, -M, or -N */ + need_sort = need_sort | mtime_sort | ignore_path_sort | merged_case_sort | numeric_sort; /* default: show statusbar only in fullscreen mode */ /* user wants to override? */ @@ -382,14 +414,16 @@ strcpy(tmp,image_names[0]); } rreaddir(dirname(image_names[0]),0); - filter_images(&images,image_names); + if(filter) + filter_images(&images,image_names); if(need_sort) qsort(image_names, images, sizeof *image_names, my_strcmp); image_idx = find_image(images,image_names,tmp); free(tmp); } else { - filter_images(&images,image_names); + if(filter) + filter_images(&images,image_names); if(need_sort) qsort(image_names, images, sizeof *image_names, my_strcmp); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qiv-2.3.1/qiv.1 new/qiv-2.3.2/qiv.1 --- old/qiv-2.3.1/qiv.1 2013-12-20 01:50:37.000000000 +0100 +++ new/qiv-2.3.2/qiv.1 2017-11-03 19:27:27.000000000 +0100 @@ -16,7 +16,7 @@ .br .br -Version: 2.3.1, released on 2013-12-20 +Version: 2.3.2, released on 2017-11-03 .br by Andy Spiegl - http://qiv.spiegl.de/ - qiv.a...@spiegl.de .br @@ -98,6 +98,9 @@ .B \-I, \-\-statusbar Enable statusbar. .TP +.B \-J, \-\-showJPEGcomments +Enable display of comment lines (in JPEG images). +.TP .B \-p, \-\-transparency Enable transparency for transparent images. .TP @@ -144,6 +147,9 @@ .B \-M, \-\-merged_case_sort Sort all the image files in merged-case order (AaBbCc...). .TP +.B \-K, \-\-mtime_sort +Sort files by their modification time +.TP .B \-N, \-\-numeric_sort A "smart" numeric sort that attempts to sort filenames with numbers in a logical manner. For instance: 2.jpg sorts before 10.jpg; 1foo.jpg @@ -168,7 +174,7 @@ a tall image is too tall to fit on the screen, it will be rotated. .TP .B \-l, \-\-autorotate -Autorotate JPEGs according to EXIF rotation tag. +Do NOT autorotate JPEGs according to EXIF rotation tag. Default is ON. .TP .B \-X, \-\-xineramascreen \fIx\fB Use monitor \fIx\fR as preferred screen @@ -180,10 +186,14 @@ Use color profile file x as display profile for all images .TP .B \-B, \-\-browse -This option is useful when configuring qiv to be used with a file manager. qiv -will scan the directory of the clicked image and allow you to scroll +This option is useful when configuring qiv to be used with a file manager. +qiv will scan the directory of the clicked image and allow you to scroll through those images. .TP +.B \-\-trashbin +Use users trash bin instead of .qiv-trash. Undeleting an image will not +work, open the trash bin and restore the image instead. +.TP .B \-\-vikeys Enable movement with h/j/k/l, vi-style (HJKL will do what hjkl previously did) .SH EXAMPLES @@ -212,7 +222,8 @@ F11/F12 in/decrease slideshow delay (1 second) a/A copy picture to .qiv-select d/D/del move picture to .qiv-trash (-R disables this feature) -u undelete the previously trashed image + (if started with --trashbin picture is moved to users trash bin) +u undelete the previously trashed image (not working if --trashbin is used) +/=/wheel r/btn fwd zoom in (10%) -/wheel l/btn back zoom out (10%) e center mode on/off @@ -240,6 +251,7 @@ enter/return reset zoom, rotation and color settings E display Exif information i statusbar on/off +J JPEG comments on/off I iconify window w watch file on/off x center image on background @@ -259,18 +271,21 @@ Button 3 previous picture Wheel Up next picture Wheel Dn previous picture -Wheel Lt/Button back zoom out (10%) -Wheel Rt/Button forward zoom in (10%) +Wheel Left/Button back zoom out (10%) +Wheel Right/Button forward zoom in (10%) .EE .SH DELETING qiv doesn't actually delete files. It creates a directory named ".qiv-trash" and moves the images to that directory. qiv maintains the directory -structure of your "deleted" images. You can also undelete the most +structure of your "deleted" images. You can also undelete the most recently trashed images in reverse order, which moves each file back -into its original directory. There is a limit to how many deletions +into its original directory. There is a limit to how many deletions can be undone, but it should be pretty large (currently 1024 items). Sometimes this feature might be unwanted. To prevent accidents you can -specify the "-R" option to disable this feature. +specify the "-R" option to disable this feature. If the "--trashbin" option +is used qiv will move the deleted pictures to the users trash bin. In that +case undeleting with pressing "u" will not work. Open the trash bin and +restore the image instead. .SH IMWHEEL SUPPORT With XFree86 3.3.2+ server, using the wheel is seen as button 4 and 5 pressed. You only have to use "IMPS/2" or "Intellimouse" for diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qiv-2.3.1/qiv.h new/qiv-2.3.2/qiv.h --- old/qiv-2.3.1/qiv.h 2013-12-20 01:50:37.000000000 +0100 +++ new/qiv-2.3.2/qiv.h 2017-11-03 19:27:27.000000000 +0100 @@ -8,6 +8,7 @@ #include <Imlib2.h> #include <unistd.h> #include <stdlib.h> +#include <ctype.h> #ifdef SUPPORT_LCMS #include <lcms2.h> #include <jpeglib.h> @@ -25,14 +26,16 @@ #include <X11/extensions/xf86vmode.h> // for XF86VidModeGetModeLine */ -#define VERSION "2.3.1" -#define VERSION_FULL "QIV - Quick Image Viewer v2.3.1 - http://qiv.spiegl.de/" +#define VERSION "2.3.2" +#define VERSION_FULL "QIV - Quick Image Viewer v2.3.2 - http://qiv.spiegl.de/" #define TRASH_DIR ".qiv-trash" #define SELECT_DIR ".qiv-select" #define SLIDE_DELAY 3000 /* milliseconds */ #define IMAGE_BG "black" #define STATUSBAR_BG "#FFB900" #define STATUSBAR_FS 8 /* default fontsize if none is given */ +#define COMMENT_BG "#DDDDDD" +#define COMMENT_FS 20 /* default fontsize if none is given */ #define ERROR_BG "#0000FF" #define DEFAULT_BRIGHTNESS 256 #define DEFAULT_CONTRAST 256 @@ -61,6 +64,7 @@ GdkGC *bg_gc; /* image window background */ GdkGC *text_gc; /* statusbar text color */ GdkGC *status_gc; /* statusbar background */ + GdkGC *comment_gc; /* comment background */ /* These are used to work out how to redraw in fullscreen mode */ gint win_ox, win_oy, win_ow, win_oh; /* coordinates currently drawn at */ @@ -73,6 +77,7 @@ // char infotext[BUF_LEN]; gchar win_title[BUF_LEN]; gint text_len, text_w, text_h; + gint comment_w, comment_h; } qiv_image; typedef struct _qiv_mgl { @@ -106,6 +111,7 @@ extern GdkColor image_bg; extern GdkColor text_bg; extern GdkColor error_bg; +extern GdkColor comment_bg; extern int images; extern char **image_names; extern int image_idx; @@ -117,6 +123,9 @@ extern PangoLayout *layout; extern PangoFontDescription *fontdesc; extern PangoFontMetrics *metrics; +extern PangoLayout *layoutComment; +extern PangoFontDescription *fontdescComment; +extern PangoFontMetrics *metricsComment; extern char *comment; extern gint jpeg_prog; extern off_t file_size; @@ -135,6 +144,7 @@ extern int maxpect; extern int statusbar_fullscreen; extern int statusbar_window; +extern int comment_window; extern int slide; extern int scale_down; extern int recursive; @@ -156,6 +166,7 @@ extern int autorotate; extern int rotation; extern int vikeys; +extern int trashbin; extern const char *helpstrs[], **helpkeys, *image_extensions[]; @@ -216,6 +227,7 @@ /* utils.c */ extern int move2trash(void); +extern int move2trashbin(void); extern int copy2select(void); extern int undelete_image(void); extern void jump2image(char *); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qiv-2.3.1/utils.c new/qiv-2.3.2/utils.c --- old/qiv-2.3.1/utils.c 2013-12-20 01:50:37.000000000 +0100 +++ new/qiv-2.3.2/utils.c 2017-11-03 19:27:27.000000000 +0100 @@ -118,6 +118,41 @@ return 0; } +/* move current image to trash bin */ +int move2trashbin() +{ + GFile *del_file; + GError *del_error=NULL; + int i; + int ret=0; + + del_file=g_file_new_for_path(image_names[image_idx]); + + if(g_file_trash(del_file, NULL, &del_error)) + { + --images; + for(i=image_idx;i<images;++i) { + image_names[i] = image_names[i+1]; + } + + /* If deleting the last file out of x */ + if(images == image_idx) + image_idx = 0; + + /* If deleting the only file left */ + if(!images) + exit(0); + } + else + { + printf("%s\n", del_error->message); + g_error_free(del_error); + ret=1; + } + g_object_unref(del_file); + return ret; +} + /* copy current image to SELECTDIR */ int copy2select() { @@ -341,8 +376,6 @@ for (i = 0; i < *numlines; i++) { lines[i] = lines[i+1]; } - update_image(q, FULL_REDRAW); - return; } stat(filename, &after); @@ -492,6 +525,7 @@ " --readonly, -R Disable the deletion feature\n" " --maxpect, -m Zoom to screen size and preserve aspect ratio\n" " --merged_case_sort, -M Sort filenames with AaBbCc... alpha order\n" + " --mtime_sort, -K Sort files by their modification time\n" " --no_filter, -n Do not filter images by extension\n" " --no_statusbar, -i Disable statusbar\n" " --statusbar, -I Enable statusbar\n" @@ -501,13 +535,15 @@ " --root_t, -y Set tiled desktop background and exit\n" " --root_s, -z Set stretched desktop background and exit\n" " --scale_down, -t Shrink image(s) larger than the screen to fit\n" + " --trashbin Use users trash bin instead of .qiv_trash when deleting\n" + " (undelete key will not work in that case)\n" " --transparency, -p Enable transparency for transparent images\n" " --watch, -T Reload the image if it has changed on disk\n" " --recursivedir, -u Recursively include all files\n" " --followlinks, -L Follow symlinks to directories (requires --recursivedir)\n" " --select_dir, -A x Store the selected files in dir x (default is .qiv-select)\n" #if GDK_PIXBUF_MINOR >= 12 - " --autorotate, -l Autorotate JPEGs according to EXIF rotation tag\n" + " --autorotate, -l Do NOT autorotate JPEGs according to EXIF rotation tag\n" #endif " --rotate, -q x Rotate 90(x=1),180(x=2),270(x=3) degrees clockwise (11 & 13 for conditional)\n" " --xineramascreen, -X x Use monitor x as preferred screen\n" @@ -515,6 +551,8 @@ " --source_profile, -Y x Use color profile file x as source profile for all images\n" " --display_profile,-Z x Use color profile file x as display profile for all images\n" #endif + " --vikeys Enable movement with h/j/k/l, vi-style\n" + " (HJKL will do what hjkl previously did)\n" " --version, -v Print version information and exit\n" "\n" "Slideshow options:\n" @@ -523,8 +561,7 @@ " --random, -r Random order\n" " --shuffle, -S Shuffled order\n" " --delay, -d x Wait x seconds between images [default=%d]\n" - " --vikeys Enable movement with h/j/k/l, vi-style\n" - " (HJKL will do what hjkl previously did)\n" "\n" + "\n" "Keys:\n", SLIDE_DELAY/1000); /* skip header and blank line */ @@ -722,7 +759,6 @@ update_image(q, REDRAW); } } - usleep(200); /* avoid eating 100% cpu */ return TRUE; } @@ -777,7 +813,7 @@ if ((infile = fopen(filename, "rb")) == NULL) { fprintf(stderr, "can't open %s\n", filename); - return NULL; + return NULL; } if (fread(pic_tst, 1, 4, infile) != 4) @@ -792,7 +828,7 @@ free(comment); comment=NULL; } - + /* Is pic a jpg? */ if ( (pic_tst[0] == 0xff) && (pic_tst[1] == 0xd8) && (pic_tst[2] == 0xff) && ((pic_tst[3]& 0xf0) == 0xe0) ) { @@ -801,14 +837,17 @@ cinfo.err = jpeg_std_error(&jerr); jpeg_create_decompress(&cinfo); - jpeg_stdio_src(&cinfo, infile); + jpeg_stdio_src(&cinfo, infile); jpeg_save_markers(&cinfo, 0xE2, 0xFFFF); jpeg_save_markers(&cinfo, JPEG_COM, 0xFFFF); jpg_ok = jpeg_read_header(&cinfo, 0); + if (jpg_ok == 0) { + qiv_exit(2); + } fclose(infile); jpeg_prog=cinfo.progressive_mode; - for (marker = cinfo.marker_list; marker != NULL; marker = marker->next) + for (marker = cinfo.marker_list; marker != NULL; marker = marker->next) { if(strncmp(icc_string, (const char *)marker->data, 11)==0) { @@ -833,6 +872,15 @@ comment=calloc(1+marker->data_length,1); if(comment==NULL) return NULL; strncpy(comment, (char *) marker->data, marker->data_length); + + /* simulate perl's chomp */ + int len = strlen(comment); + while (isspace(comment[len-1])) + { + comment[len-1] = 0; + if(--len==0) + break; + } } } if(i==0) @@ -863,7 +911,7 @@ return icc_ptr; } /* is pic a tiff?*/ - else if((pic_tst[0] == pic_tst[1]) && ((pic_tst[0] == 0x49)||(pic_tst[0] == 0x4d)) && (pic_tst[2] == 0x2a) && (pic_tst[3] == 0x00)) + else if((pic_tst[0] == pic_tst[1]) && ((pic_tst[0] == 0x49)||(pic_tst[0] == 0x4d)) && (pic_tst[2] == 0x2a) && (pic_tst[3] == 0x00)) { uint16 count; unsigned char *data; @@ -1002,7 +1050,7 @@ snprintf(line, 255, "%-21s: %s\n", "Comment", comment); exif_lines[j++]=line; } - + return exif_lines; } #endif @@ -1019,7 +1067,7 @@ CARD16 power_level; if(DPMSQueryExtension(disp, ¬_needed, ¬_needed)) - { + { if(DPMSCapable(disp)) { DPMSInfo(disp, &power_level, &dpms_enabled);