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: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#11399: closed (24.1.50; [PATCH] image-mode scaling fix)
Date: Mon, 14 May 2012 05:18:02 +0000
[Message part 1 (text/plain, inline)]
Your message dated Mon, 14 May 2012 01:17:01 -0400
with message-id <jwvwr4fibq6.fsf-monnier+emacs <at> gnu.org>
and subject line Re: 24.1.50; [PATCH] image-mode scaling fix
has caused the debbugs.gnu.org bug report #11399,
regarding 24.1.50; [PATCH] image-mode scaling fix
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)


-- 
11399: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11399
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Wolfgang Jenkner <wjenkner <at> inode.at>
To: bug-gnu-emacs <at> gnu.org
Cc: Glenn Morris <rgm <at> gnu.org>
Subject: 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




[Message part 3 (message/rfc822, inline)]
From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: 11399-done <at> debbugs.gnu.org
Subject: Re: 24.1.50; [PATCH] image-mode scaling fix
Date: Mon, 14 May 2012 01:17:01 -0400
Thank you Wolfgang,
I installed your patch,


        Stefan


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

Previous Next


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