Subject: bug#11399: closed (Re: 24.1.50; [PATCH] image-mode scaling fix)

From: [email-masked] (GNU bug Tracking System)
Date: Mon, 14 May 2012 05:18:02 +0000

Your bug report

#11399: 24.1.50; [PATCH] image-mode scaling fix

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
11399: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11399
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: 24.1.50; [PATCH] image-mode scaling fix
From: Stefan Monnier <[email-masked]>
To: [email-masked]
Date: Mon, 14 May 2012 01:17:01 -0400
List-Id: <debbugs-submit.debbugs.gnu.org>

Thank you Wolfgang,
I installed your patch,

        Stefan

Subject: 24.1.50; [PATCH] image-mode scaling fix
From: Wolfgang Jenkner <[email-masked]>
To: [email-masked]
Cc: Glenn Morris <[email-masked]>
Date: Thu, 03 May 2012 18:53:58 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

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  <[email-masked]>

	* 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