emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] master f2b16e4: :max-width/height fixes for shr after the


From: Lars Ingebrigtsen
Subject: [Emacs-diffs] master f2b16e4: :max-width/height fixes for shr after the scaling changes
Date: Sat, 14 May 2016 20:57:57 +0000 (UTC)

branch: master
commit f2b16e44721a07c59279e91d7cd34777fa30fbdf
Author: Lars Ingebrigtsen <address@hidden>
Commit: Lars Ingebrigtsen <address@hidden>

    :max-width/height fixes for shr after the scaling changes
    
    * lisp/net/shr.el (shr-rescale-image): Ensure that we respect
    max-width and max-height even after the scaling changes done
    earlier this year.
---
 lisp/net/shr.el |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/lisp/net/shr.el b/lisp/net/shr.el
index d91b00c..9d42fde 100644
--- a/lisp/net/shr.el
+++ b/lisp/net/shr.el
@@ -1016,14 +1016,17 @@ WIDTH and HEIGHT are the sizes given in the HTML data, 
if any."
            (max-width (truncate (* shr-max-image-proportion
                                    (- (nth 2 edges) (nth 0 edges)))))
            (max-height (truncate (* shr-max-image-proportion
-                                    (- (nth 3 edges) (nth 1 edges))))))
+                                    (- (nth 3 edges) (nth 1 edges)))))
+           (scaling (image-compute-scaling-factor image-scaling-factor)))
       (when (or (and width
                      (> width max-width))
                 (and height
                      (> height max-height)))
         (setq width nil
               height nil))
-      (if (and width height)
+      (if (and width height
+               (< (* width scaling) max-width)
+               (< (* height scaling) max-height))
           (create-image
            data 'imagemagick t
            :ascent 100



reply via email to

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