bug-gnu-emacs
[Top][All Lists]
Advanced

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

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


From: Wolfgang Jenkner
Subject: bug#11399: 24.1.50; [PATCH] image-mode scaling fix
Date: Thu, 03 May 2012 18:53:58 +0200
User-agent: Gnus/5.130004 (Ma Gnus v0.4) Emacs/24.1.50 (berkeley-unix)

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@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







reply via email to

[Prev in Thread] Current Thread [Next in Thread]