summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWolfgang Jenkner <wjenkner@inode.at>2012-11-23 18:41:01 +0100
committerWolfgang Jenkner <wjenkner@inode.at>2012-11-23 18:41:01 +0100
commit977f932513ce1d8ee73eafb73e39d51774021fab (patch)
tree0e3432db42001f8ca814309d3d931afcb2291ac4
parent0d4bb04f1a82acacdcfffa0bb1a42393365608db (diff)
downloademacs-977f932513ce1d8ee73eafb73e39d51774021fab.tar.gz
lisp/image-mode.el (image-transform-check-size): Use assertions only
for images of type imagemagick. Otherwise no error, image-transform-fit-to-{width,height} is silently ignored, as before. Doc fix.
-rw-r--r--lisp/ChangeLog8
-rw-r--r--lisp/image-mode.el10
2 files changed, 16 insertions, 2 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index eed11358baf..be04ad733f0 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,11 @@
+2012-11-23 Wolfgang Jenkner <wjenkner@inode.at>
+
+ * image-mode.el (image-transform-check-size): Use assertions only
+ for images of type imagemagick.
+
+ Otherwise no error, image-transform-fit-to-{width,height} is
+ silently ignored, as before. Doc fix.
+
2012-11-23 Chong Yidong <cyd@gnu.org>
* faces.el (color-defined-p): Doc fix (Bug#12853).
diff --git a/lisp/image-mode.el b/lisp/image-mode.el
index 4ac62fbb6fc..0e91567a29a 100644
--- a/lisp/image-mode.el
+++ b/lisp/image-mode.el
@@ -746,8 +746,14 @@ close to a multiple of 90, see `image-transform-right-angle-fudge'."
h)))))
(defun image-transform-check-size ()
- "Check that the image exactly fits the width/height of the window."
- (unless (numberp image-transform-resize)
+ "Check that the image exactly fits the width/height of the window.
+
+Do this for an image of type `imagemagick' to make sure that the
+elisp code matches the way ImageMagick computes the bounding box
+of a rotated image."
+ (when (and (not (numberp image-transform-resize))
+ (boundp 'image-type)
+ (eq image-type 'imagemagick))
(let ((size (image-display-size (image-get-display-property) t)))
(cond ((eq image-transform-resize 'fit-width)
(cl-assert (= (car size)