From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/61163 Path: news.gmane.org!not-for-mail From: Reiner Steib Newsgroups: gmane.emacs.gnus.general Subject: Image formats for gnus-(x-)face-from-file Date: Thu, 13 Oct 2005 22:12:35 +0200 Organization: Dept. of Theoretical Physics, University of Ulm Message-ID: Reply-To: Reiner Steib NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: sea.gmane.org 1129235105 23297 80.91.229.2 (13 Oct 2005 20:25:05 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 13 Oct 2005 20:25:05 +0000 (UTC) Original-X-From: ding-owner+m9696@lists.math.uh.edu Thu Oct 13 22:25:02 2005 Return-path: Original-Received: from malifon.math.uh.edu ([129.7.128.13]) by ciao.gmane.org with esmtp (Exim 4.43) id 1EQ9a3-0000rs-Kv for ding-account@gmane.org; Thu, 13 Oct 2005 22:21:36 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu ident=lists) by malifon.math.uh.edu with smtp (Exim 3.20 #1) id 1EQ9Zy-0008Jj-00; Thu, 13 Oct 2005 15:21:30 -0500 Original-Received: from nas01.math.uh.edu ([129.7.128.39]) by malifon.math.uh.edu with esmtp (Exim 3.20 #1) id 1EQ9ZE-0008Je-00 for ding@lists.math.uh.edu; Thu, 13 Oct 2005 15:20:44 -0500 Original-Received: from quimby.gnus.org ([80.91.224.244]) by nas01.math.uh.edu with esmtp (Exim 4.52) id 1EQ9ZB-0001II-Ek for ding@lists.math.uh.edu; Thu, 13 Oct 2005 15:20:44 -0500 Original-Received: from main.gmane.org ([80.91.229.2] helo=ciao.gmane.org) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1EQ9Z8-0001oY-00 for ; Thu, 13 Oct 2005 22:20:38 +0200 Original-Received: from list by ciao.gmane.org with local (Exim 4.43) id 1EQ9Vw-0007N3-97 for ding@gnus.org; Thu, 13 Oct 2005 22:17:20 +0200 Original-Received: from bridgekeeper.physik.uni-ulm.de ([134.60.10.123]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 13 Oct 2005 22:17:20 +0200 Original-Received: from Reiner.Steib by bridgekeeper.physik.uni-ulm.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 13 Oct 2005 22:17:20 +0200 X-Injected-Via-Gmane: http://gmane.org/ Mail-Followup-To: ding@gnus.org Original-To: ding@gnus.org Original-Lines: 113 Original-X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: bridgekeeper.physik.uni-ulm.de X-Face: mtjf/D:es1T0wHO:&CJ'ZXe"l;3C--rw\z!{`eFwL){|]RpI+4{u25L=5C /0>KuGeTsk<~<&NE-AKV1560e!+RJeyWmSskkrJm?[vUV#66{T_m|Ae<||Ku#Mk5`y&O`n~z2;n8eP J5#2h@2eQgV@E70IY_0WlEx!"&giy{+\%h1LJox$zv@/l%ZmU4^tZA>xQpnkUBVC5.jpg#0'(+2?Rs )NAr:>3<=WxHE$ktbLysDIM5TbmHu*3 --=-=-= Hi, the following patch allows for use different input image formats by using convert(1) to generate Face and X-Face headers. Currently `gnus-x-face-from-file' requires GIF and `gnus-face-from-file' requires JPEG. For me, the current `gnus-x-face-from-file' command doesn't even work (and I saw similar reports on Google): $ giftopnm face.gif | ppmnorm | pnmscale -width 48 -height 48 | ppmtopgm |\ pgmtopbm | pbmtoxbm | compface giftopnm: Reading Image Sequence 0 ppmnorm: remapping 65..233 to 0..255 compface: (warning) : excess data ignored compface: (warning) : excess data ignored $ Is it okay to change the defaults? --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=rs-gnus-fun-face-w-convert.patch --- gnus-fun.el 29 Aug 2005 16:37:45 +0200 7.9 +++ gnus-fun.el 13 Oct 2005 21:56:20 +0200 @@ -45,21 +45,37 @@ :group 'gnus-fun :type 'string) -(defcustom gnus-convert-image-to-x-face-command "giftopnm %s | ppmnorm | pnmscale -width 48 -height 48 | ppmtopgm | pgmtopbm | pbmtoxbm | compface" +(defcustom gnus-convert-image-to-x-face-command + "convert -resize 48x48 %s xbm:- | xbm2xface.pl" "Command for converting an image to an X-Face. +The command must take a image filename (use \"%s\") as input. +The output must be the Face header data on stdout in PNG format. + By default it takes a GIF filename and output the X-Face header data on stdout." :version "22.1" :group 'gnus-fun - :type 'string) + :type '(choice (const :tag "giftopnm, netpbm (GIF input only)" + "giftopnm %s | ppmnorm | pnmscale -width 48 -height 48 | ppmtopgm | pgmtopbm | pbmtoxbm | compface") + (const :tag "convert" + "convert -resize 48x48 %s xbm:- | xbm2xface.pl") + (string))) -(defcustom gnus-convert-image-to-face-command "djpeg %s | ppmnorm | pnmscale -width 48 -height 48 | ppmquant %d | pnmtopng" +(defcustom gnus-convert-image-to-face-command + "convert -resize 48x48 %s -colors %d png:-" "Command for converting an image to a Face. -By default it takes a JPEG filename and output the Face header data -on stdout." + +The command must take an image filename (first format +argument\"%s\") and the number of colors (second format argument: +\"%d\") as input. The output must be the Face header data on +stdout in PNG format." :version "22.1" :group 'gnus-fun - :type 'string) + :type '(choice (const :tag "djpeg, netpbm (JPG input only)" + "djpeg %s | ppmnorm | pnmscale -width 48 -height 48 | ppmquant %d | pnmtopng") + (const :tag "convert" + "convert -resize 48x48 %s -colors %d png:-") + (string))) (defcustom gnus-face-properties-alist (if (featurep 'xemacs) '((xface . (:face gnus-x-face))) @@ -125,8 +141,11 @@ ;;;###autoload (defun gnus-x-face-from-file (file) - "Insert an X-Face header based on an image file." - (interactive "fImage file name (by default GIF): ") + "Insert an X-Face header based on an image file. + +Depending on `gnus-convert-image-to-x-face-command' it may accept +different input formats." + (interactive "fImage file name: ") (when (file-exists-p file) (gnus-shell-command-to-string (format gnus-convert-image-to-x-face-command @@ -134,8 +153,11 @@ ;;;###autoload (defun gnus-face-from-file (file) - "Return a Face header based on an image file." - (interactive "fImage file name (by default JPEG): ") + "Return a Face header based on an image file. + +Depending on `gnus-convert-image-to-face-command' it may accept +different input formats." + (interactive "fImage file name: ") (when (file-exists-p file) (let ((done nil) (attempt "") --=-=-= Bye, Reiner. -- ,,, (o o) ---ooO-(_)-Ooo--- | PGP key available | http://rsteib.home.pages.de/ --=-=-=--