From d1fbe1c3932f643bde62a5c42ac01b3caaa15254 Mon Sep 17 00:00:00 2001 From: Lars Magne Ingebrigtsen Date: Sat, 17 Sep 2011 12:02:10 +0000 Subject: [PATCH] mm-decode.el (mm-inline-media-tests): Support imagemagick images. --- lisp/gnus/ChangeLog | 4 ++++ lisp/gnus/mm-decode.el | 16 +++++++++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index 211c4455717..fa22d1a5ea1 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/ChangeLog @@ -1,3 +1,7 @@ +2011-09-17 Lars Magne Ingebrigtsen + + * mm-decode.el (mm-inline-media-tests): Support imagemagick images. + 2011-09-15 Lars Magne Ingebrigtsen * gnus-sum.el (gnus-summary-read-group-1): Bump the "Retrieving" diff --git a/lisp/gnus/mm-decode.el b/lisp/gnus/mm-decode.el index 692175d471f..6e56213c327 100644 --- a/lisp/gnus/mm-decode.el +++ b/lisp/gnus/mm-decode.el @@ -195,7 +195,7 @@ before the external MIME handler is invoked." ("image/tiff" mm-inline-image (lambda (handle) - (mm-valid-and-fit-image-p 'tiff handle)) ) + (mm-valid-and-fit-image-p 'tiff handle))) ("image/xbm" mm-inline-image (lambda (handle) @@ -265,6 +265,20 @@ before the external MIME handler is invoked." ("multipart/alternative" ignore identity) ("multipart/mixed" ignore identity) ("multipart/related" ignore identity) + ("image/*" + mm-inline-image + (lambda (handle) + (and (mm-valid-image-format-p 'imagemagick) + (mm-with-unibyte-buffer + (mm-insert-part handle) + (let ((image + (ignore-errors + (if (fboundp 'create-image) + (create-image (buffer-string) 'imagemagick 'data-p) + (mm-create-image-xemacs type))))) + (when image + (setcar (cdr handle) (list "image/imagemagick")) + (mm-image-fit-p handle))))))) ;; Disable audio and image ("audio/.*" ignore ignore) ("image/.*" ignore ignore) -- 2.39.2