[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#440768: marked as done (xli: -zoom auto)



Your message dated Thu, 21 Feb 2008 16:32:13 +0000
with message-id <E1JSELF-0004xt-EU@ries.debian.org>
and subject line Bug#440768: fixed in xli 1.17.0+20061110-2
has caused the Debian Bug report #440768,
regarding xli: -zoom auto
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact owner@bugs.debian.org
immediately.)


-- 
440768: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=440768
Debian Bug Tracking System
Contact owner@bugs.debian.org with problems
--- Begin Message ---
Package: xli
Version: 1.17.0-22
Severity: wishlist
Tags: patch

This patch implements the "-zoom auto" feature suggested in xli's TODO file.
It doesn't implement the related TODO item of merging -zoom and -iscale.

With -zoom auto, images smaller than 90% of the screen size are displayed
un-zoomed. Images larger than 90% of the screen size are reduced to fit.

diff -ruNp a/TODO b/TODO
--- a/TODO	2000-02-09 04:23:32.000000000 -0500
+++ b/TODO	2007-09-03 23:31:28.000000000 -0500
@@ -22,7 +22,6 @@ add vicar reader, copyright Noel Gorelic
 developed by NASA/JPL.'
 
 make fast image scaling a subfeature of -zoom, eliminate -iscale
-and add -zoom auto
 
 add a TIFF reader?
 
diff -ruNp a/xli.man b/xli.man
--- a/xli.man     2007-09-03 22:40:08.000000000 -0500
+++ b/xli.man     2007-09-04 00:02:38.000000000 -0500
@@ -317,6 +317,9 @@ more information.  Technically the perce
 square of the number supplied since the zoom is to both axes, but I
 opted for consistency instead of accuracy.
 .TP
+\-zoom auto
+Zoom large images to fit the screen; don't zoom small images.
+.TP
 \-newoptions
 Reset options that propagate.  The \fI\-bright, \-colors, \-colordither, \-delay,
 \-dither, \-gamma, \-gray, \-normalize, \-smooth, \-xzoom, \-yzoom\fR, and
diff -ruNp a/misc.c b/misc.c
--- a/misc.c	2000-02-09 04:23:33.000000000 -0500
+++ b/misc.c	2007-09-03 22:40:36.000000000 -0500
@@ -104,6 +104,8 @@ char *tail(char *path)
 	return (t);
 }
 
+#define MIN(a,b) ( (a)<(b) ? (a) : (b))
+
 Image *processImage(DisplayInfo *dinfo, Image *iimage, ImageOptions *options)
 {
 	Image *image = iimage, *tmpimage;
@@ -132,6 +134,19 @@ Image *processImage(DisplayInfo *dinfo, 
 		image = tmpimage;
 	}
 	/* zoom image */
+	if (options->zoom_auto) {
+		if (image->width > globals.dinfo.width * .9)
+			options->xzoom = globals.dinfo.width * 90 / image->width;
+		else
+			options->xzoom = 100;
+		if (image->height > globals.dinfo.height * .9)
+			options->yzoom = globals.dinfo.height * 90 / image->height;
+		else
+			options->yzoom = 100;
+		/* both dimensions should be shrunk by the same factor */
+		options->xzoom = options->yzoom =
+			MIN(options->xzoom, options->yzoom);
+	}
 	if (options->xzoom || options->yzoom) {
 		/* if the image is to be blown up, compress before doing it */
 		if (!options->colors && RGBP(image) &&	
diff -ruNp a/options.c b/options.c
--- a/options.c	1999-10-24 21:15:00.000000000 -0500
+++ b/options.c	2007-09-03 23:54:39.000000000 -0500
@@ -731,11 +731,16 @@ int doLocalOption(OptionId opid, char **
 
 	case ZOOM:
 		if (argv[++a]) {
-			if (atoi(argv[a]) < 0) {
-				printf("Zoom argument must be positive (ignored).\n");
-				break;
+			if (!strcmp(argv[a], "auto")) {
+                                image_ops->zoom_auto = TRUE;
+                        } else {
+				if (atoi(argv[a]) < 0) {
+					printf("Zoom argument must be positive (ignored).\n");
+					break;
+				}
+				image_ops->xzoom = image_ops->yzoom = atoi(argv[a]);
+				image_ops->zoom_auto = FALSE;
 			}
-			image_ops->xzoom = image_ops->yzoom = atoi(argv[a]);
 			if (setpersist)
 				persist_ops->xzoom = persist_ops->yzoom = image_ops->xzoom;
 		}
diff -ruNp a/xli.c b/xli.c
--- a/xli.c	2000-02-09 04:23:35.000000000 -0500
+++ b/xli.c	2007-09-03 22:40:36.000000000 -0500
@@ -541,6 +541,7 @@ int main(int argc, char *argv[])
 				break;
 			}
 			io->xzoom = io->yzoom = 0;
+			io->zoom_auto = 0;
 			io->iscale_auto = 0;
 
 			if (globals.verbose) {
diff -ruNp a/xli.h b/xli.h
--- a/xli.h	1999-10-24 21:15:07.000000000 -0500
+++ b/xli.h	2007-09-03 22:40:36.000000000 -0500
@@ -55,6 +55,7 @@ typedef struct {
 	char *title;		/* Override title on image */
 	unsigned int xzoom, yzoom;
 				/* zoom percentages */
+	boolean zoom_auto;	/* automatically zoom to fit on screen */
 	char *fg, *bg;		/* foreground/background colors if mono image */
 	boolean done_to;	/* TRUE if we have already looked for trailing
 				 * options

-- System Information:
Debian Release: 4.0
  APT prefers stable
  APT policy: (500, 'stable')
Architecture: powerpc (ppc)
Shell:  /bin/sh linked to /bin/dash
Kernel: Linux 2.6.22.1
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)

Versions of packages xli depends on:
ii  libc6                  2.3.6.ds1-13etch2 GNU C Library: Shared libraries
ii  libjpeg62              6b-13             The Independent JPEG Group's JPEG 
ii  libpng12-0             1.2.15~beta5-1    PNG library - runtime
ii  libx11-6               2:1.0.3-7         X11 client-side library
ii  libxext6               1:1.0.1-2         X11 miscellaneous extension librar
ii  zlib1g                 1:1.2.3-13        compression library - runtime

xli recommends no packages.

-- no debconf information


--- End Message ---
--- Begin Message ---
Source: xli
Source-Version: 1.17.0+20061110-2

We believe that the bug you reported is fixed in the latest version of
xli, which is due to be installed in the Debian FTP archive:

xli_1.17.0+20061110-2.diff.gz
  to pool/main/x/xli/xli_1.17.0+20061110-2.diff.gz
xli_1.17.0+20061110-2.dsc
  to pool/main/x/xli/xli_1.17.0+20061110-2.dsc
xli_1.17.0+20061110-2_sparc.deb
  to pool/main/x/xli/xli_1.17.0+20061110-2_sparc.deb



A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 440768@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Bernhard R. Link <brlink@debian.org> (supplier of updated xli package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@debian.org)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Format: 1.7
Date: Thu, 21 Feb 2008 16:01:44 +0100
Source: xli
Binary: xli
Architecture: source sparc
Version: 1.17.0+20061110-2
Distribution: unstable
Urgency: low
Maintainer: Debian QA Group <packages@qa.debian.org>
Changed-By: Bernhard R. Link <brlink@debian.org>
Description: 
 xli        - command line tool for viewing images in X11
Closes: 166541 440768
Changes: 
 xli (1.17.0+20061110-2) unstable; urgency=low
 .
   * QA upload
   * incorporate "-zoom auto" patch from Alan Curry (Closes: 440768)
   * document < and > for zooming (Closes: 166541)
   * move Homepage pseudo-header to proper header
   * bump Standards-Version to 3.7.3
   * set debhelper compatibility to 5
Files: 
 42743e8cec89e16259d9b061abe317f5 721 graphics optional xli_1.17.0+20061110-2.dsc
 88e800fc37145877d95397a07dfdbfb8 28605 graphics optional xli_1.17.0+20061110-2.diff.gz
 d884bc5f5cd1fd314dafc548e84d05bf 152138 graphics optional xli_1.17.0+20061110-2_sparc.deb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFHvaL5TrAWvKplQe4RAu6bAJ49yoIqmNgE/MFngWs01Y4ybIoRRwCfWrri
CGRYXt4XL/9PwJPhhfsPgrs=
=dPU5
-----END PGP SIGNATURE-----



--- End Message ---

Reply to: