Re: w3mimgdisplay use?
- To: mutt-users@xxxxxxxx
- Subject: Re: w3mimgdisplay use?
- From: Sertaç Ö. Yıldız <sertac.liste@xxxxxxxxx>
- Date: Sat, 10 Nov 2007 01:29:44 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:date:from:to:subject:message-id:mail-followup-to:references:mime-version:content-type:content-disposition:content-transfer-encoding:in-reply-to:user-agent; bh=zkBYLBx2tOo9RI4WxjT6nsvSAwd01hmxQU5Sq8hmm5Y=; b=boxmRrCxiNuWUcXTrwSyrRrIYvj3A0sJA67B10oxaTKPBJS7Dq8YDZ5OQ40WvfBQWZw1ECVcTSil0qIiO3uv+DrfK5WL1IV6lJIl5x6YyURpHf9O1bgB/G7qkD2DKw6FBFRZAv5oYbcywjraev4IYYt/Xo2uNK4fQpAB1wddGJM=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:date:from:to:subject:message-id:mail-followup-to:references:mime-version:content-type:content-disposition:content-transfer-encoding:in-reply-to:user-agent; b=XtVDXMvPCBGcnPvyauLZwWx73drLJc4Yzao/ufMCfeQ2gCO8RFf7ZXddpY3fos/RwIkOplVz2hr3Omy5cZ+BHHt7py/hBRfB/N9zdZRGL9335y5fRrngPx3oHZfz0yrYXvdlNxoVOWakJF99/BF5IQo19iHTkCQpoML1ttFUwqQ=
- In-reply-to: <20071109211613.GE20630@xxxxxxxxxxxxx>
- List-post: <mailto:mutt-users@mutt.org>
- List-unsubscribe: send mail to majordomo@mutt.org, body only "unsubscribe mutt-users"
- Mail-followup-to: mutt-users@xxxxxxxx
- References: <20071109211613.GE20630@xxxxxxxxxxxxx>
- Sender: owner-mutt-users@xxxxxxxx
- User-agent: Mutt/1.5.17 (2007-11-01)
* Kyle Wheeler [09.Kas.07 15:16 -0600]:
> Does anyone know how to use w3mimgdisplay to display images on the
> terminal (or if its even possible)? I'm hoping to be able to put it in
> my mailcap so that when I view an attached image, it'll display it on
> the terminal.
>
> I've gotten as far as understanding that it has an input command
> language, so I can query the size of the image, like so:
>
> echo '5;./test.jpg' | w3mimgdisplay
The w3mimg protocol is documented in the source files like this:
0 1 2 ....
+--+--+--+--+ ...... +--+--+
|op|; |args |\n|
+--+--+--+--+ .......+--+--+
args is separeted by ';'
op args
0; params draw image
1; params redraw image
2; -none- terminate drawing
3; -none- sync drawing
4; -none- nop, sync communication
response '\n'
5; path get size of image,
response "<width> <height>\n"
6; params(6) clear image
params
<n>;<x>;<y>;<w>;<h>;<sx>;<sy>;<sw>;<sh>;<path>
params(6)
<x>;<y>;<w>;<h>
> And I *believe* the command to display an image looks something like
> this:
>
> echo '0;1;2;3;4;5;6;7;8;9;./test.jpg' | w3mimgdisplay
Yes, reads from stdin, writes to stdout. You might also just execute
w3mimgdisplay and type your commands there. Check the source for command
line parameters it accepts.
> But as of yet, I haven't actually gotten it to display anything. Does
> anyone have any clues? Are there some magic incantations that must be
> performed first? Image-specific numbers that must be generated? What's
> the trick?
Start by strace'ing w3m?
--
~sertaç