Lars Ingebrigtsen <[email protected]> čálii: > Kevin Brubeck Unhammer <[email protected]> writes: > >> After some digging, it seems gnus-rescale-image returns early on some >> articles because >> >> (not (get-buffer-window (current-buffer))) >> >> For articles where it works, current-buffer is >> #<buffer *Article meh*> >> >> For articles where it returns early, current-buffer is >> #<buffer *mm-uu*-591048> >> >> (Why does gnus-rescale-image need a current-buffer window anyway?) > > That's a good question. Off the top of my head, I can't see any > particular reason for that limitation. > > Anybody?
I've been running with
(defun gnus-rescale-image (image size)
"Rescale IMAGE to SIZE if possible.
SIZE is in format (WIDTH . HEIGHT). Return a new image.
Sizes are in pixels."
(if (or (not (fboundp 'imagemagick-types))
;; (not (get-buffer-window (current-buffer)))
)
image
(let ((new-width (car size))
(new-height (cdr size)))
(when (> (cdr (image-size image t)) new-height)
(setq image (or (create-image (plist-get (cdr image) :data)
'imagemagick t
:height new-height)
image)))
(when (> (car (image-size image t)) new-width)
(setq image (or
(create-image (plist-get (cdr image) :data) 'imagemagick t
:width new-width)
image)))
image)))
for a while, and not seen any issues so far. It's been better than the
alternative so far.
signature.asc
Description: PGP signature
_______________________________________________ info-gnus-english mailing list [email protected] https://lists.gnu.org/mailman/listinfo/info-gnus-english
