GNU bug report logs - #11399
24.1.50; [PATCH] image-mode scaling fix

Previous Next

Package: emacs;

Reported by: Wolfgang Jenkner <wjenkner <at> inode.at>

Date: Thu, 3 May 2012 17:33:01 UTC

Severity: normal

Tags: patch

Found in version 24.1.50

Done: Stefan Monnier <monnier <at> iro.umontreal.ca>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Wolfgang Jenkner <wjenkner <at> inode.at>
To: 11399 <at> debbugs.gnu.org
Cc: Glenn Morris <rgm <at> gnu.org>
Subject: bug#11399: 24.1.50; [PATCH] image-mode scaling fix
Date: Thu, 03 May 2012 18:53:58 +0200
This takes care of a FIXME in image-mode.el, viz. "2 works, but eg 1.9
or 0.5 don't?".  To expand on this a bit: Make sure some image format,
say jpg, is really handled by ImageMagick.  Visit a jpg file and do

M-x i m a g e - t r a n s f o r m - s e t - s c a l e <return> 1 . 9 <return>


2012-05-03  Wolfgang Jenkner  <wjenkner <at> inode.at>

	* image-mode.el (image-transform-resize): Doc fix.
	(image-transform-properties): Default scale is 1 and height should
	be an integer.


=== modified file 'lisp/image-mode.el'
--- lisp/image-mode.el	2012-02-08 03:45:27 +0000
+++ lisp/image-mode.el	2012-05-03 15:48:02 +0000
@@ -634,7 +634,7 @@
  - nil, meaning no resizing.
  - `fit-height', meaning to fit the image to the window height.
  - `fit-width', meaning to fit the image to the window width.
- - A number, which is a scale factor (the default size is 100).")
+ - A number, which is a scale factor (the default size is 1).")
 
 (defvar image-transform-rotation 0.0
   "Rotation angle for the image in the current Image mode buffer.")
@@ -655,8 +655,8 @@
 	   (height
 	    (cond
 	     ((numberp image-transform-resize)
-	      (unless (= image-transform-resize 100)
-		(* image-transform-resize (cdr size))))
+	      (unless (= image-transform-resize 1)
+		(floor (* image-transform-resize (cdr size)))))
 	     ((eq image-transform-resize 'fit-height)
 	      (- (nth 3 (window-inside-pixel-edges))
 		 (nth 1 (window-inside-pixel-edges))))))
@@ -669,7 +669,6 @@
 	,@(if (not (equal 0.0 image-transform-rotation))
 	      (list :rotation image-transform-rotation))))))
 
-;; FIXME 2 works, but eg 1.9 or 0.5 don't?
 (defun image-transform-set-scale (scale)
   "Prompt for a number, and resize the current image by that amount.
 This command has no effect unless Emacs is compiled with






This bug report was last modified 13 years and 71 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.