Re: Displaying thumbnails of attached images?

Greg Bognar <[email protected]> Wed, 22 Aug 2018 12:18:39 +0200
Newsgroups gmane.mail.wanderlust.general
Message-ID <877ekiso00.wl-greg.bognar__16275.8780330934$1534933117$gmane$org@startmail.com>
Thanks, exactly what I had in mind!

On Tue 21 Aug 2018 at 13:14 Kazuhiro Ito wrote:
> Hi,
> 
> > Sometimes I get emails with image attachments (e.g., photos).  WL
> > displays the attachments in the original size (usually too big for
> > the screen), and as far as I can tell there is no way to zoom out in
> > the message buffer.  I also don't seem to be able to navigate
> > between the attachments when there are many images (the keybindings
> > p and n do not work reliably), hence sometimes I can't even tell how
> > many attachments the email contains.  Does anyone have a better way
> > to deal with image attachments?
> 
> If your Emacs has imagemagick support, override mime-display-image
> with below and you can get thumbnailed image.
> 
> (defun mime-display-image (entity situation)
>   (message "Decoding image...")
>   (condition-case err
>       (let ((format (cdr (assq 'image-format situation)))
> 	    image)
> 	(setq image
> 	      (mime-image-create (mime-entity-content entity)
> 				 'imagemagick 'data
> 				 :max-height 360
> 				 :max-width 240
> 				 ))
> 	(if (null image)
> 	    (message "Invalid glyph!")
> 	  (save-excursion
> 	    (mime-image-insert image)
> 	    (insert "\n")
> 	    (message "Decoding image...done"))))
>     (error
>      (message "%s" err))))
> 
> -- 
> Kazuhiro Ito
>