From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/82738 Path: news.gmane.org!not-for-mail From: asjo@koldfront.dk (Adam =?iso-8859-1?Q?Sj=F8gren?=) Newsgroups: gmane.emacs.gnus.general Subject: Re: Displaying picture from PGP key if present? Date: Wed, 26 Dec 2012 02:12:52 +0100 Organization: koldfront - analysis & revolution, Copenhagen, Denmark Message-ID: <87d2xxy5t7.fsf@topper.koldfront.dk> References: <87ehirwgjq.fsf@topper.koldfront.dk> <87ip7quzk3.fsf@gnus.org> <87mwx2s62p.fsf@topper.koldfront.dk> <87vcbqtk8q.fsf@gnus.org> <87ip7qs5fm.fsf@topper.koldfront.dk> <878v8mtjbg.fsf@gnus.org> <874njas1yf.fsf@topper.koldfront.dk> <87623qb5vl.fsf@gnus.org> <87sj6t7oe5.fsf@topper.koldfront.dk> <87obhhybna.fsf@topper.koldfront.dk> <87ip7py7mq.fsf@topper.koldfront.dk> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1356484404 27413 80.91.229.3 (26 Dec 2012 01:13:24 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 26 Dec 2012 01:13:24 +0000 (UTC) To: ding@gnus.org Original-X-From: ding-owner+M31004@lists.math.uh.edu Wed Dec 26 02:13:40 2012 Return-path: Envelope-to: ding-account@gmane.org Original-Received: from util0.math.uh.edu ([129.7.128.18]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1TnfYw-00006h-1K for ding-account@gmane.org; Wed, 26 Dec 2012 02:13:38 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu) by util0.math.uh.edu with smtp (Exim 4.63) (envelope-from ) id 1TnfYV-00021N-Ig; Tue, 25 Dec 2012 19:13:11 -0600 Original-Received: from mx2.math.uh.edu ([129.7.128.33]) by util0.math.uh.edu with esmtps (TLSv1:AES256-SHA:256) (Exim 4.63) (envelope-from ) id 1TnfYS-000212-Lv for ding@lists.math.uh.edu; Tue, 25 Dec 2012 19:13:08 -0600 Original-Received: from quimby.gnus.org ([80.91.231.51]) by mx2.math.uh.edu with esmtps (TLSv1:AES256-SHA:256) (Exim 4.76) (envelope-from ) id 1TnfYR-0000Kh-Gm for ding@lists.math.uh.edu; Tue, 25 Dec 2012 19:13:08 -0600 Original-Received: from plane.gmane.org ([80.91.229.3]) by quimby.gnus.org with esmtp (Exim 4.72) (envelope-from ) id 1TnfYQ-0000iy-3o for ding@gnus.org; Wed, 26 Dec 2012 02:13:06 +0100 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1TnfYa-0008J6-Kj for ding@gnus.org; Wed, 26 Dec 2012 02:13:16 +0100 Original-Received: from 2505ds5-by.0.fullrate.dk ([89.150.142.116]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 26 Dec 2012 02:13:16 +0100 Original-Received: from asjo by 2505ds5-by.0.fullrate.dk with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 26 Dec 2012 02:13:16 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 28 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 2505ds5-by.0.fullrate.dk OpenPGP: id=21BDE416; url=http://asjo.koldfront.dk/gpg.asc Mail-Follow-Up-To: never X-Now-Playing: Rich Man's War, The Revolution Starts Now (Steve Earle) X-Face: )qY&CseJ?.:=8F#^~GcSA?F=9eu'{KAFfL1C3/A&:nE?PW\i65"ba0NS)97,Q(^@xk}n4Ou rPuR#V8I(J_@~H($[ym:`K_+]*kjvW>xH5jbgLBVFGXY:(#4P>zVBklLbdL&XxL\M)%T}3S/IS9lMJ ^St'=VZBR Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:82738 Archived-At: On Wed, 26 Dec 2012 01:33:33 +0100, Adam wrote: > So, I'm kind of stuck on that. Skipping the first 16 bytes and using a non-multibyte buffer on the way makes it work with --attribute-fd: (defun epg-key-image (key-id) "Return the image of a key, if any" (with-temp-buffer (set-buffer-multibyte nil) (let* ((coding-system-for-write 'binary) (coding-system-for-read 'binary) (data (shell-command-to-string (concat epg-gpg-program " --attribute-fd 2" " --list-keys " key-id " >/dev/null")))) (when (> (length data) 0) (insert (substring data 16)) (create-image (buffer-string) nil t))))) Best regards, Adam -- "Vejen ender, bålet brænder Adam Sjøgren Det brænder for dig, Alexander" asjo@koldfront.dk