emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] trunk r112982: lisp/gnus/mml2015.el (mml2015-maximum-key-i


From: Katsumi Yamaoka
Subject: [Emacs-diffs] trunk r112982: lisp/gnus/mml2015.el (mml2015-maximum-key-image-dimension): New user option to control the maximum size of photo ID image
Date: Fri, 14 Jun 2013 03:24:11 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 112982
revision-id: address@hidden
parent: address@hidden
author: David Edmondson <address@hidden>
committer: Katsumi Yamaoka <address@hidden>
branch nick: trunk
timestamp: Fri 2013-06-14 03:24:05 +0000
message:
  lisp/gnus/mml2015.el (mml2015-maximum-key-image-dimension): New user option 
to control the maximum size of photo ID image
  (mml2015-epg-key-image-to-string): Respect it
modified:
  lisp/gnus/ChangeLog            changelog-20091113204419-o5vbwnq5f7feedwu-1433
  lisp/gnus/mml2015.el           mml2015.el-20091113204419-o5vbwnq5f7feedwu-3261
=== modified file 'lisp/gnus/ChangeLog'
--- a/lisp/gnus/ChangeLog       2013-06-14 03:22:26 +0000
+++ b/lisp/gnus/ChangeLog       2013-06-14 03:24:05 +0000
@@ -1,3 +1,9 @@
+2013-06-14  David Edmondson  <address@hidden>  (tiny change)
+
+       * mml2015.el (mml2015-maximum-key-image-dimension): New user option to
+       control the maximum size of photo ID image.
+       (mml2015-epg-key-image-to-string): Respect it.
+
 2013-06-13  Lars Magne Ingebrigtsen  <address@hidden>
 
        * shr.el (shr-tag-table-1): Mark the preliminary table renderings

=== modified file 'lisp/gnus/mml2015.el'
--- a/lisp/gnus/mml2015.el      2013-05-22 13:18:40 +0000
+++ b/lisp/gnus/mml2015.el      2013-06-14 03:24:05 +0000
@@ -146,6 +146,11 @@
   :group 'mime-security
   :type 'boolean)
 
+(defcustom mml2015-maximum-key-image-dimension 64
+  "The maximum dimension (width or height) of any key images."
+  :group 'mime-security
+  :type 'integer)
+
 ;; Extract plaintext from cleartext signature.  IMO, this kind of task
 ;; should be done by GnuPG rather than Elisp, but older PGP backends
 ;; (such as Mailcrypt, and PGG) discard the output from GnuPG.
@@ -873,13 +878,20 @@
         (insert (substring data 16))
         (create-image (buffer-string) nil t)))))
 
+(autoload 'gnus-rescale-image "gnus-util")
+
 (defun mml2015-epg-key-image-to-string (key-id)
   "Return a string with the image of a key, if any"
   (let* ((result "")
          (key-image (mml2015-epg-key-image key-id)))
     (when key-image
       (setq result "  ")
-      (put-text-property 1 2 'display key-image result))
+      (put-text-property
+       1 2 'display
+       (gnus-rescale-image key-image
+                          (cons mml2015-maximum-key-image-dimension
+                                mml2015-maximum-key-image-dimension))
+       result))
     result))
 
 (defun mml2015-epg-signature-to-string (signature)


reply via email to

[Prev in Thread] Current Thread [Next in Thread]