Re: w3mimgdisplay use?

2007-11-10 Thread Sertaç Ö . Yıldız
* Kyle Wheeler [09.Kas.07 17:59 -0600]:
  n - ?

This is used when displaying multiple images on a terminal window, and 
holds the index of the images in the cache.

  x - x coordinate to draw the image at (top left corner)
  y - y coordinate to draw the image at (top left corner)

Correct.

  w - width to draw the image
  h - height to draw the image

These are the width/height of the original image to draw.

  sx - ???
  xy - ???
  sw - width of the original (source) image
  sh - height of the original (source) image

These parameters are for the actual image drawn on the window. Probably 
's' stands for 'seen' or 'shown'. 'sx' and 'sy' are offsets from 'x' and 
'y' respectively.

 After playing around, I figured out that sx and sy allow you to crop 
 off parts of the top and left of the image... like it means start 
 drawing from sx and sy in the image, which makes some sense.

Yes, w3m uses these to redraw partly drawn images from cache when 
scrolling.

 I still can't figure out what n means, though. ...perhaps it has 
 something to do with animated gifs?

Animation frames are also drawn as separate images, so yes.

But if you need to tweak these n and s parameters, I'd suggest calling  
w3m directly and letting it handle the details.

-- 
~sertaç


Re: w3mimgdisplay use?

2007-11-09 Thread Patrick Shanahan
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

* Kyle Wheeler [EMAIL PROTECTED] [11-09-07 16:16]:
 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.
 [...]

w3m image.jpg

will display a jpg in a non-X console

- -- 
Patrick Shanahan Plainfield, Indiana, USAHOG # US1244711
http://wahoo.no-ip.org Photo Album:  http://wahoo.no-ip.org/gallery2
Registered Linux User #207535@ http://counter.li.org
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.4-svn4472 (GNU/Linux)

iD8DBQFHNNJNClSjbQz1U5oRAl5sAJ984Z6s+U9NvIz5T0NXuxznVbtsZACfZOaS
BArtAC3tycRYVYWfWIScG8w=
=9NFS
-END PGP SIGNATURE-


w3mimgdisplay use?

2007-11-09 Thread Kyle Wheeler
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hello,

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

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

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?

~Kyle

P.S. Yes, I know that w3mimgdisplay has to be a persistent process, so 
the echo line up there won't *quite* work... but I'm still stumped as 
to what the correct behavior is.
- -- 
If the president is the head of the American body politic, Congress is 
its gastrointestinal tract. Its vast and convoluted inner workings may 
be mysterious and unpleasant, but in the end they excrete a great deal 
of material whose successful passage is crucial to our nation's 
survival. This is Congress's duty.
 -- Jon Stewart
-BEGIN PGP SIGNATURE-
Comment: Thank you for using encryption!

iD8DBQFHNM4dBkIOoMqOI14RAuDZAKDlZkN754F45HL3mzIZbNiNLpFQygCgvvzv
qen6lSMJpUKBNFcA34vEhIA=
=qDcS
-END PGP SIGNATURE-


Re: w3mimgdisplay use?

2007-11-09 Thread Kyle Wheeler
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On Friday, November  9 at 04:34 PM, quoth Patrick Shanahan:
* Kyle Wheeler [EMAIL PROTECTED] [11-09-07 16:16]:
 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.
 [...]

w3m image.jpg

will display a jpg in a non-X console

Ahhh, I see - it requires that I turn off the 'use external image 
viewer' option (because otherwise it just uses ImageMagic's `display` 
command). Interesting. That... *kinda* answers my question. At least, 
good enough for the moment. Thanks!

~Kyle
- -- 
If we knew what it was we were doing, it would not be called research, 
would it?
   -- Albert Einstein, 1941
-BEGIN PGP SIGNATURE-
Comment: Thank you for using encryption!

iD8DBQFHNOU6BkIOoMqOI14RAm5WAKD5lKIpPS9OyQhbl1jrUwMWx6AuNACdHlAe
RBRBDtHWgRX+gD9ouUwGo/c=
=j40+
-END PGP SIGNATURE-


Re: w3mimgdisplay use?

2007-11-09 Thread Kyle Wheeler
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On Friday, November  9 at 03:16 PM, quoth Kyle Wheeler:
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

AHA! I figured it out by dissecting the X-Face patch by Tamo. For 
posterity, here's how you do it:

 echo -e '2;3;\n0;1;0;0;0;0;0;0;0;0;./test.jpg\n4;\n3; | w3mimgdisplay

Now, I'm not 100% sure WHY it works or what the other commands are in 
there for, but it does work.

P.S. Yes, I know that w3mimgdisplay has to be a persistent process, 
so the echo line up there won't *quite* work... but I'm still stumped 
as to what the correct behavior is.

That's not true: it does not have to be a persistent process. It's 
just that w3m uses it as a persistent process to handle scrolling 
around without needing to keep fork()/exec()'ing all the time.

This all said, while it's nifty and all, w3m is a nicer *viewer* 
because it handles all the scrolling and such.

However... this may be useful for viewing images *inline* (if they're 
small enough)... time to play around! :)

~Kyle
- -- 
You cannot reason a person out of a position he did not reason himself 
into in the first place.
  -- Jonathan Swift
-BEGIN PGP SIGNATURE-
Comment: Thank you for using encryption!

iD8DBQFHNOq/BkIOoMqOI14RAlrnAJ9vCxqI6YupAcUp0jDqN/VQS/iu9gCg6lhv
xnR+NH+KUK+ABQFmsaRdrJ0=
=Mqho
-END PGP SIGNATURE-


Re: w3mimgdisplay use?

2007-11-09 Thread Patrick Shanahan
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

* Kyle Wheeler [EMAIL PROTECTED] [11-09-07 18:18]:
 
 This all said, while it's nifty and all, w3m is a nicer *viewer* 
 because it handles all the scrolling and such.
 
 However... this may be useful for viewing images *inline* (if they're 
 small enough)... time to play around! :)


have a look at fbi
http://freshmeat.net/projects/fbi

also handles framebuffer graphics w/resize,etc
and will handle a list or directory

- -- 
Patrick Shanahan Plainfield, Indiana, USAHOG # US1244711
http://wahoo.no-ip.org Photo Album:  http://wahoo.no-ip.org/gallery2
Registered Linux User #207535@ http://counter.li.org
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.4-svn4472 (GNU/Linux)

iD8DBQFHNOybClSjbQz1U5oRAiJHAJ9sGYA68DWhpJSZBYMRN9aFqJdJUQCggIc+
MjRDiV04WZfTAYfE1E9+IyU=
=FJ/T
-END PGP SIGNATURE-


Re: w3mimgdisplay use?

2007-11-09 Thread Sertaç Ö . Yıldız
* 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;  pathget 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ç


Re: w3mimgdisplay use?

2007-11-09 Thread Kyle Wheeler
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On Friday, November  9 at 06:26 PM, quoth Patrick Shanahan:
have a look at fbi
http://freshmeat.net/projects/fbi

also handles framebuffer graphics w/resize,etc
and will handle a list or directory

Interesting. Unfortunately, it doesn't seem to work for me---first, it 
won't compile against libexif 0.6.16-1 (the version in Ubuntu---it 
complains that exif_entry_get_value needs more arguments), second, my 
OSX box doesn't have framebuffer support (w3mimgdisplay appears to be 
calling the X11 libraries to do its business).

I also looked at fbv, which has similar problems.

It would appear that w3mimgdisplay is unusable (at least without 
modifying mutt) for auto_view'ing images, because mutt redraws the 
screen too much, and thus the image disappears as quickly as it's 
drawn.

Ah, well... on the plus side, because w3mimgdisplay uses the X11 
libraries, I can ssh into my main box and still view images! :D

~Kyle
- -- 
To invent, you need a good imagination and a pile of junk.
-- Thomas Jefferson
-BEGIN PGP SIGNATURE-
Comment: Thank you for using encryption!

iD8DBQFHNPEgBkIOoMqOI14RAp51AKD03WTOKnVyTUaZ3t4/2ZhzdfpgGwCgnnAK
f0oCKk9ABw75YLTxJyYvsUA=
=KsrN
-END PGP SIGNATURE-


Re: w3mimgdisplay use?

2007-11-09 Thread Kyle Wheeler
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On Saturday, November 10 at 01:29 AM, quoth Sertaç Ö. Yıldız:
* Kyle Wheeler [09.Kas.07 15:16 -0600]:
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;  pathget 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

True, and I saw that, however it doesn't really explain what all those 
things mean. What is n? x? y? w? h? I mean, I can make some reasonable 
guesses for most of them:

 n - ?
 x - x coordinate to draw the image at (top left corner)
 y - y coordinate to draw the image at (top left corner)
 w - width to draw the image
 h - height to draw the image
 sx - ???
 xy - ???
 sw - width of the original (source) image
 sh - height of the original (source) image

Thanks, though!

~Kyle
- -- 
If you make people think they're thinking, they'll love you; but if 
you really make them think, they'll hate you.
 -- Don Marquis
-BEGIN PGP SIGNATURE-
Comment: Thank you for using encryption!

iD8DBQFHNPIJBkIOoMqOI14RAiw/AJ92lcrd1ULnIm3NVyQYHJP1jmNIJQCg/2F/
6JeDLFnsKGEURTlhDy0it38=
=u7p4
-END PGP SIGNATURE-


Re: w3mimgdisplay use?

2007-11-09 Thread Kyle Wheeler
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On Friday, November  9 at 05:49 PM, quoth Kyle Wheeler:
 n - ?
 x - x coordinate to draw the image at (top left corner)
 y - y coordinate to draw the image at (top left corner)
 w - width to draw the image
 h - height to draw the image
 sx - ???
 xy - ???
 sw - width of the original (source) image
 sh - height of the original (source) image

After playing around, I figured out that sx and sy allow you to crop 
off parts of the top and left of the image... like it means start 
drawing from sx and sy in the image, which makes some sense.

I still can't figure out what n means, though. ...perhaps it has 
something to do with animated gifs?

~Kyle
- -- 
Patriotism means to stand by the country. It does not mean to stand by 
the President.
  -- Theodore Roosevelt
-BEGIN PGP SIGNATURE-
Comment: Thank you for using encryption!

iD8DBQFHNPRcBkIOoMqOI14RAmSQAJ9vht4oL1omYMfBWzME6AGhlWQNRgCfQI26
MXonQyU3bbvkAzNQUh9OoHk=
=rGef
-END PGP SIGNATURE-


Re: w3mimgdisplay use?

2007-11-09 Thread Joseph

On 11/09/07 15:16, Kyle Wheeler wrote:

Hello,

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

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

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?


~Kyle


Have a look at this link:
http://www.df7cb.de/projects/mutt/x-face/

Is it what you looking for?

--
#Joseph
GPG KeyID: ED0E1FB7