From: Mark Trettin <Mark.Trettin@gmx.de>
Subject: Re: compface
Date: Wed, 16 Jan 2002 07:56:24 +0100 [thread overview]
Message-ID: <m3elkqkcmf.fsf@beldin.mt743742.dialup.rwth-aachen.de> (raw)
In-Reply-To: <iluk7ujgrrj.fsf@extundo.com> (Simon Josefsson's message of "Tue, 15 Jan 2002 23:42:56 +0100")
* 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
next prev parent reply other threads:[~2002-01-16 6:56 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-01-15 22:42 compface Simon Josefsson
2002-01-16 2:17 ` compface Karl Kleinpaste
2002-01-16 2:39 ` compface Lars Magne Ingebrigtsen
2002-01-16 2:54 ` compface John H. Palmieri
2002-01-16 4:03 ` compface Karl Kleinpaste
2002-01-16 5:52 ` compface Bill White
2002-01-16 6:56 ` Mark Trettin [this message]
2002-01-16 12:37 ` compface Simon Josefsson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=m3elkqkcmf.fsf@beldin.mt743742.dialup.rwth-aachen.de \
--to=mark.trettin@gmx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).