From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/42067 Path: main.gmane.org!not-for-mail From: Mark Trettin Newsgroups: gmane.emacs.gnus.general Subject: Re: compface Date: Wed, 16 Jan 2002 07:56:24 +0100 Organization: Aachen University of Technology (RWTH), Germany Sender: owner-ding@hpc.uh.edu Message-ID: References: NNTP-Posting-Host: coloc-standby.netfonds.no Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: main.gmane.org 1035177363 9449 80.91.224.250 (21 Oct 2002 05:16:03 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 21 Oct 2002 05:16:03 +0000 (UTC) Return-Path: Original-Received: (qmail 23596 invoked from network); 16 Jan 2002 06:59:59 -0000 Original-Received: from malifon.math.uh.edu (mail@129.7.128.13) by mastaler.com with SMTP; 16 Jan 2002 06:59:59 -0000 Original-Received: from sina.hpc.uh.edu ([129.7.128.10] ident=lists) by malifon.math.uh.edu with esmtp (Exim 3.20 #1) id 16Qk2j-0005Rn-00; Wed, 16 Jan 2002 00:59:29 -0600 Original-Received: by sina.hpc.uh.edu (TLB v0.09a (1.20 tibbs 1996/10/09 22:03:07)); Wed, 16 Jan 2002 00:59:23 -0600 (CST) Original-Received: from sclp3.sclp.com (qmailr@sclp3.sclp.com [209.196.61.66]) by sina.hpc.uh.edu (8.9.3/8.9.3) with SMTP id AAA27353 for ; Wed, 16 Jan 2002 00:59:10 -0600 (CST) Original-Received: (qmail 23590 invoked by alias); 16 Jan 2002 06:59:11 -0000 Original-Received: (qmail 23585 invoked from network); 16 Jan 2002 06:59:11 -0000 Original-Received: from r220-1.rz.rwth-aachen.de (134.130.3.31) by gnus.org with SMTP; 16 Jan 2002 06:59:11 -0000 Original-Received: from r220-1.rz.RWTH-Aachen.DE (relay2.RWTH-Aachen.DE [134.130.3.1]) by r220-1.rz.RWTH-Aachen.DE (8.10.1/8.11.3-2) with ESMTP id g0G6x6q14731 for ; Wed, 16 Jan 2002 07:59:06 +0100 (MET) Original-Received: from beldin.mt743742.dialup.rwth-aachen.de (dialin-145-254-133-123.arcor-ip.net [145.254.133.123]) by r220-1.rz.RWTH-Aachen.DE (8.10.1/8.11.3/6) with ESMTP id g0G6x4v14727 for ; Wed, 16 Jan 2002 07:59:05 +0100 (MET) Original-Received: from beldin.mt743742.dialup.rwth-aachen.de ([127.0.0.1]) by beldin.mt743742.dialup.rwth-aachen.de (8.11.3/8.11.3/SuSE Linux 8.11.1-0.5) with ESMTP id g0G6uOe01140 for ; Wed, 16 Jan 2002 07:56:24 +0100 Mail-Copies-To: never Original-To: ding@gnus.org X-Face: 2ng|LW~1$MclJ,} (Simon Josefsson's message of "Tue, 15 Jan 2002 23:42:56 +0100") User-Agent: Gnus/5.090005 (Oort Gnus v0.05) XEmacs/21.4 (Civil Service, i686-pc-linux) X-Now-Playing: Theatre of Tragedy's =?iso-8859-1?q?=5FA=E9gis=5F:_"Ang=E9lique"?= Original-Lines: 67 Precedence: list X-Majordomo: 1.94.jlt7 Xref: main.gmane.org gmane.emacs.gnus.general:42067 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:42067 * On: Tue, 15 Jan 2002 23:42:56 +0100 Simon Josefsson writes: > The compface's I have tried (compface RPMs and compface from freshmeat) > doesn't seem to work, or maybe the pbmtoxbm program I have doesn't work. > Compface seem to want 48 lines each containing of 16 bit C integers, but > pbmtoxbm outputs a C character array. pbmtox10bm (X10 bitmap format) > outputs 16 bit integers but not three per line. If I manually edit it > to make compface happy it outputs the X-Face in this message, which > looks corrupt. Any ideas? Maybe the following Perl-Skript works for you too -- it is part of the SuSi 7.2 compface-Package: --8<----------------------- schnipp ------------------------>8--- #!/usr/bin/perl # # xbm2xface -- convert a 48x48 xbm file to an xface header # # Stig@hackvan.com sub reverse_byte { local($byte) = @_; local($n, $b); for ( $b= $n= 0; $b<8; ++$b) { $n |= (($byte & 1) << (7-$b)); $byte >>= 1; } return($n); } #printf "0x%02x\n", &reverse_byte(0xF0); <>; m/^#define \w+_width (\d+)/ && ($width=$1); <>; m/^#define \w+_height (\d+)/ && ($height=$1); <>; m/^static.* = \{/ && (( $width == 48 && $height == 48 ) || die "xfaces are 48x48" ); open(CF,"|compface"); while (<>) { $st=""; while (s/(0x..)(,|\};)\s*//) { $st .= sprintf("0x%02x, ", &reverse_byte(eval($1))); } $_=$st; s/(0x..), 0x(..)/\1\2/g; s/\s*(0x...., 0x...., 0x....)(,|\};)\s/\1,\n/g; print CF $_; } close (CF); --8<----------------------- schnapp ------------------------>8--- With that the following should work (on-the-fly-convertion): (setq gnus-convert-image-to-x-face-command "giftopnm %s | ppmnorm 2>/dev/null | pnmscale 2>/dev/null -width 48 -height 48 | ppmtopgm | pgmtopbm | pbmtoxbm | xbm2xface.pl") [...] HTH Mark -- Mark Trettin · Aachen · Germany · Where is Aachen? --> N: 50°46' E: 06°05' BOFH excuse #53: Little hamster in running wheel had coronary; waiting for replacement to be Fedexed from Wyoming