X-Git-Url: https://code.delx.au/gnu-emacs/blobdiff_plain/73071b4cdb45deb27052788c5c928ab809e878e0..90fb0b2d13d0f44ecb9606587681cb4d8a6f0225:/lisp/net/shr.el diff --git a/lisp/net/shr.el b/lisp/net/shr.el index d91b00ca77..68972020db 100644 --- a/lisp/net/shr.el +++ b/lisp/net/shr.el @@ -37,6 +37,7 @@ (require 'dom) (require 'seq) (require 'svg) +(require 'image) (defgroup shr nil "Simple HTML Renderer" @@ -296,8 +297,10 @@ image under point instead. If called twice, then try to fetch the URL and see whether it redirects somewhere else." (interactive "P") - (let ((url (or (get-text-property (point) 'shr-url) - (get-text-property (point) 'image-url)))) + (let ((url (if image-url + (get-text-property (point) 'image-url) + (or (get-text-property (point) 'shr-url) + (get-text-property (point) 'image-url))))) (cond ((not url) (message "No URL under point")) @@ -1016,14 +1019,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