how to "read" pictures in mosaic 
Author Message
 how to "read" pictures in mosaic

This may be quite a silly question (and I hope in the right group):
This is about Perl and WWW-Mosaic
How can I read in a file in which pictures are linked?
When I do this on the xmosaic Unix there are not too many problems (none to be
precisely) When I try to this on Windows the pictures just ain't there? I mean th Perl script
reads the lines but does not read the pictures. When I just rearange mosaic for Windows or
I view the source, then it shows the pictures as I wanted to...

What to do??

Ups Klaas Hermann Schreiber

Fri, 02 May 1997 20:30:44 GMT  
 how to "read" pictures in mosaic


>This may be quite a silly question (and I hope in the right group):

  You didn't specify what perl program you were using and I'm not
sure what your question is, but I have done what you are trying to do.
Here's a quick summary of HTTP:

 1) open a TCP port to the web server (usually port 80)
 2) send "GET /path HTTP/1.0\n" and close the connection
 3) recieve HTTP header followed by a blank line
 4) grab the rest as HTML data (or GIF or whatever)

do all the above for you. Available on the Web, of course. See FAQ for
Perl sites on the web)

If the HTTP header has a 'content-type' line, then that will tell you if
you are getting HTML, GIF, etc..
  If you want the in-line images, then you must parse the <IMG HREF="foo.gif">
and send another request to the server (with a complete pathname, of course).

Now, I want to read in a GIF and send it out as a bunch of hex digits
specifying a monochrome bitmap. I use "giftoppm|ppmtopgm|pgmtopbm" to
get a series of 0's and 1's.  But how do I convert that into hex?
Currently, I do something like this:
    1) insert spaces every 4 characters
    2) replace '1111' with 'F', '1110' with 'E', ... '0000' with '0'
    3) delete all the spaces
Can't I speed this up by using "pack" or something? Even better, can I
parse my GIF in Perl? (and as a related question, how do I do Floyd-
Steinberg dithering when converting to monochrome?)


Dangerous  Dan | only outlaws will have laws. | Sim Stim decks

Thu, 08 May 1997 10:28:37 GMT  
 [ 3 post ] 

 Relevant Pages 

1. "Picture of the day"

2. "character class ""bug""

3. system(("cp", "-Rf", "/tmp/a/*", "/tmp/b")); doesnt wrk

4. how to parse a "this", "that", "and the ", "other" file

5. "NEED CASH $$$$$ READ HERE $$$$$"

6. Problems reading "NUMBER" with DBI/oracle

7. how to read die "Error:..."

8. help reading a "pst" mail file

9. "The opposite of read()"

10. reading from binmode() as "unsigned chars"

11. How to use "read()"

12. Help reading pipes "unbuffered"?


Powered by phpBB® Forum Software