Lars Ingebrigtsen čálii: > Kevin Brubeck Unhammer 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 >> # >> >> For articles where it returns early, current-buffer is >> # >> >> (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.