Re: max-size for displayed PGP image on signed email?
On 11 Apr 2018, Lars Ingebrigtsen wrote: > Kevin Brubeck Unhammerwrites: > >> 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))) >> ) > > I've now applied a similar fix to Emacs 27. Thanks for testing. FWIW, this is another possibility ;; if nil, ignores images in pgp-keys (setq mml2015-display-key-image 'nil) Which was added to Gnus in May 2014 http://git.gnus.org/cgit/gnus.git/commit/?id=cae09469fa95d33e40ead0a2dcff45f815c275ce -- A visit to a strange place will bring fresh work. ___ info-gnus-english mailing list info-gnus-english@gnu.org https://lists.gnu.org/mailman/listinfo/info-gnus-english
Re: max-size for displayed PGP image on signed email?
Kevin Brubeck Unhammerwrites: > 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))) > ) I've now applied a similar fix to Emacs 27. Thanks for testing. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no ___ info-gnus-english mailing list info-gnus-english@gnu.org https://lists.gnu.org/mailman/listinfo/info-gnus-english
Re: max-size for displayed PGP image on signed email?
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. signature.asc Description: PGP signature ___ info-gnus-english mailing list info-gnus-english@gnu.org https://lists.gnu.org/mailman/listinfo/info-gnus-english
Re: max-size for displayed PGP image on signed email?
Kevin Brubeck Unhammer unham...@fsfe.org 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? -- (domestic pets only, the antidote for overdose, milk.) bloggy blog http://lars.ingebrigtsen.no/ ___ info-gnus-english mailing list info-gnus-english@gnu.org https://lists.gnu.org/mailman/listinfo/info-gnus-english
Re: max-size for displayed PGP image on signed email?
Lars Ingebrigtsen la...@gnus.org writes: Kevin Brubeck Unhammer unham...@fsfe.org writes: I like how gnus shows the image belonging to the key of a signed email, but some people have really big heads or something and I have to scroll a lot to get to what they actually wrote. Is it possible to have gnus auto-resize the image to a maximum size like 70px? That should be possible, but I can't really find what function is showing the signed email image at all. Do you know what package it's in? Resizing already seems to be happening in mml2015-epg-key-image-to-string according to mml2015-maximum-key-image-dimension, but now I see there are just some emails where the resizing doesn't happen (even though the function is called, and the signer is the same). 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?) -- Kevin Brubeck Unhammer GPG: 0x766AC60C signature.asc Description: PGP signature ___ info-gnus-english mailing list info-gnus-english@gnu.org https://lists.gnu.org/mailman/listinfo/info-gnus-english
Re: max-size for displayed PGP image on signed email?
Kevin Brubeck Unhammer unham...@fsfe.org writes: I like how gnus shows the image belonging to the key of a signed email, but some people have really big heads or something and I have to scroll a lot to get to what they actually wrote. Is it possible to have gnus auto-resize the image to a maximum size like 70px? That should be possible, but I can't really find what function is showing the signed email image at all. Do you know what package it's in? -- (domestic pets only, the antidote for overdose, milk.) bloggy blog http://lars.ingebrigtsen.no/ ___ info-gnus-english mailing list info-gnus-english@gnu.org https://lists.gnu.org/mailman/listinfo/info-gnus-english