cgi.gif or cgi.jpg

cgi.gif or cgi.jpg

Post by Dim » Thu, 02 Dec 1999 04:00:00



Hi! clever minds!
Does someone know how to make
dynamic gif or jpg with CGI ?
e.g. i want to make spetial graphical counter

--
-=Dim

 
 
 

cgi.gif or cgi.jpg

Post by Rich Wareha » Thu, 02 Dec 1999 04:00:00



> Hi! clever minds!
> Does someone know how to make
> dynamic gif or jpg with CGI ?
> e.g. i want to make spetial graphical counter

At the moment your CGI scripts/progs probably spew out the following (\n
means new-line)

Content-Type: text\html\n\n

This tells the browser what to treat the following data as. Change
'text\html' to 'image\jpeg' and it'll treat the rest of the data as a
JPEG file. Change it to 'image\gif' and it'll treat it as a GIF.

You just neeed to generate your JPEG or GIF from whatever data you want
and send it to stdout.

Alternatively, you could save it to a temporary file and send the
following header on its own:

Location: <tempfile>\n\n

To cause the web-browser to redirect its fetch to <tempfile>.

HTH

Rich

--

  |\/\/|   | Robinson College,
  ~~~~~~   | Cambridge, CB3 9AN

 
 
 

cgi.gif or cgi.jpg

Post by Nate Eldredg » Thu, 02 Dec 1999 04:00:00




> > Hi! clever minds!
> > Does someone know how to make
> > dynamic gif or jpg with CGI ?
> > e.g. i want to make spetial graphical counter

> At the moment your CGI scripts/progs probably spew out the following (\n
> means new-line)

> Content-Type: text\html\n\n

Oughtn't that to be a front slash?

Content-Type: text/html\n\n

--

Nate Eldredge

 
 
 

cgi.gif or cgi.jpg

Post by Dim » Fri, 03 Dec 1999 04:00:00


Dear Rich
Thank you for usefull idea
But the main problem is to form .gif
how can i load .gif and  draw text ?
-= regards Dim
 
 
 

cgi.gif or cgi.jpg

Post by Rich Wareha » Fri, 03 Dec 1999 04:00:00





> > > Hi! clever minds!
> > > Does someone know how to make
> > > dynamic gif or jpg with CGI ?
> > > e.g. i want to make spetial graphical counter

> > At the moment your CGI scripts/progs probably spew out the following (\n
> > means new-line)

> > Content-Type: text\html\n\n

> Oughtn't that to be a front slash?

> Content-Type: text/html\n\n

Yes. Wasn't really thinking when I was writing (too busy trying to solve
a PHysics problem!).

Rich

> --

> Nate Eldredge


--

  |\/\/|   | Robinson College,
  ~~~~~~   | Cambridge, CB3 9AN
 
 
 

cgi.gif or cgi.jpg

Post by Vlada » Mon, 06 Dec 1999 04:00:00


Shouldn't be too hard...


>Dear Rich
>Thank you for usefull idea
>But the main problem is to form .gif
>how can i load .gif and  draw text ?
>-= regards Dim

Either read from a file (i.e.: some_image.gif) and just include
proper header for it, or you can simply code the image (.gif or
.jpg) in your source, treat it as a string (const) and push back
selectively...

But I have a question too...
I know there are GIF libraries coming with Linux, (got RH6.0),
so I wonder are they "enough to do any possible thing with
GIFs"...

I think that is clear enough, but than again...
Would like to know exactly what is needed and where's the best
place(s) to look for a detailed documentation, I'm not worried
about legal side of the LZW compression issue, nothing to be
done is gonna be professional work...

So if I went trough some of Compuserve's documentation on GIF,
found out a few things about concept itself, where to look for
more thorough information on (de)compresion, and knowing more
about concept itself surely wouldn't hurt...

It's so much nicer when somebody tells what to do than reading
megabytes to learn two lines... and yet...

nice, easy life...

tnx
V.

 
 
 

cgi.gif or cgi.jpg

Post by phil-news-nos.. » Tue, 07 Dec 1999 04:00:00



| But I have a question too...
| I know there are GIF libraries coming with Linux, (got RH6.0),
| so I wonder are they "enough to do any possible thing with
| GIFs"...

There is the GD library.  Older versions did compression of GIF and
newer versions don't.  I believe GD has migrated to PNG but I haven't
looked at GD lately since I dismissed it long ago due to its poor
handling of GIF features.

I wrote my own library called ANGIF.  Unlike GD, ANGIF unbundled the
image composing functions from the file formatting functions.  ANGIF
only converts in memory images (in 3 formats) to GIF.  But ANGIF does
handle more advanced forms of GIF, including animation (you just call
one of the functions for each frame in the sequence, after the header
is set up), and true-color (2 of the formats are RGB formats, either
as type long in 0x00RRGGBB form, or as 3 floats for R,G,B linear).
ANGIF includes NO LZW compression, so images are not compressed and
therefore will not be as small as they could be.  JPEG and PNG will
be better for most things, but still some things uncompressed GIF is
still good at.

http://phil.ipal.org/freeware/angif/

| I think that is clear enough, but than again...
| Would like to know exactly what is needed and where's the best
| place(s) to look for a detailed documentation, I'm not worried
| about legal side of the LZW compression issue, nothing to be
| done is gonna be professional work...

The GIF89A specification is the formal authority.  I don't have any
references on hand for LZW compression, but much source code is all
over the net for it in many forms.

| So if I went trough some of Compuserve's documentation on GIF,
| found out a few things about concept itself, where to look for
| more thorough information on (de)compresion, and knowing more
| about concept itself surely wouldn't hurt...

Surely.

| It's so much nicer when somebody tells what to do than reading
| megabytes to learn two lines... and yet...

GIF is an easy, but often misunderstood, format.  For example most
people believe GIF files are limited to 256 colors.  This is not
true.  Yet, many GIF encoders are capable of no more than 256 colors.
I suspect this comes from the fact that when GIF first arrived on
the scene, a 256 color video card for a PC was state-of-the-art, and
so everything centered around dithering and color selections to get
down to 256 colors (and many did it quite well).

GIF has image blocks which encode part of the whole image with a
subset size and position.  These blocks are limited to 256 colors,
but there is no limit on the number of blocks.  ANGIF uses a simple
divide-and-conquer recursive algorithm to slice up the image into
image blocks as needed to get all colors encoded.  You do get a
funky looking image load order as a result.

Take a look at:

    http://phil.ipal.org/jpl-images/mpl.gif

This is a HUGE file (9 meg) so it will take a while to load up.  But
compare it to the "browse resolution" that JPL has online at:

    http://www2.jpl.nasa.gov/files/images/browse/mpl.gif

You can see the order the blocks are encoded (depth first), and of
course the quality of not reducing the number of colors from the
original:

    http://www2.jpl.nasa.gov/files/images/hi-res/mpl.tif

which has 8878 different colors (as does my GIF).

(all above images are courtesy NASA/JPL/Caltech)

--
| Phil Howard - KA9WGN | for headlines that | Just say no to absurd patents |

| Dallas - Texas - USA | linuxhomepage.com  | Shop http://bn.com/ instead   |

 
 
 

cgi.gif or cgi.jpg

Post by Vlada » Tue, 28 Dec 1999 04:00:00


Hey...
Pretty cool of you...




>| But I have a question too...
>| I know there are GIF libraries coming with Linux, (got
RH6.0),
>| so I wonder are they "enough to do any possible thing with
>| GIFs"...

>There is the GD library.  Older versions did compression of GIF
and
>newer versions don't.  I believe GD has migrated to PNG but I
haven't
>looked at GD lately since I dismissed it long ago due to its
poor
>handling of GIF features...

...

Thanks and wish you well,
Vladan

 
 
 

1. /cgi-bin/phf /cgi-bin/test-cgi /cgi-bin/handler

I've been seeing a number of attacks of this sort recently
from various sites in the http logs.  The time correlation
between the logs on various hosts suggests that the attacker
was scanning sequentially upward in IP addresses.  Since all
tcp and udp packets to ports below 1024 except for http,
smtp, and ident are filtered out for most, including the
attacking, sites, I'm not seeing anything else in the logs.

209.61.73.47 - - [04/Jul/1998:07:19:27 -0500] "GET /cgi-bin/phf" 404 -
209.61.73.47 - - [04/Jul/1998:07:19:28 -0500] "GET /cgi-bin/test-cgi" 404 -
209.61.73.47 - - [04/Jul/1998:07:19:28 -0500] "GET /cgi-bin/handler" 404 -

Is this a signature of some known attackware?  If so, what
other attacks accompany these http probes?

--

2. PCI woes with case...

3. CGI doesn't display GIF

4. HELP! X-Flicker

5. I get "file permissions deny server execution" on gif files in cgi-bin, why?

6. Memorex CD-R/RW drive supported?

7. Animated Gifs in Cgi redirection

8. Uniplex/Lyrix under 4.3

9. Apache/CGI: How to toggle an ErrorDocument from a CGI ?

10. announce: cgi++ v2.0: a c++ library for cgi script handling

11. cgi-bin and cgi file security

12. CGI won't execute - cgi pointing into htdocs directory

13. Perl CGI script gets CGI params as ARGV arguments under Apache2