AOL Webserver - Nsgd -- updated (finally)

This is Interesting: Free IT Magazines  
Home > Archive > AOL Webserver > December 2005 > Nsgd -- updated (finally)





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Nsgd -- updated (finally)
Matthew Burke

2005-12-24, 5:48 pm

Nsgd is a module for AOLserver that allows you to create graphics on
the fly via a Tcl binding to Tom Boutell's Gd library. There is a new
version of nsgd in the CVS repository at [1]. So you could have
something like the URL http://example.com/smiley invoke the following
script:


set img [gd create 300 300]
set black [gd color new $img 0 0 0]
set red [gd color new $img 255 0 0]
set blue [gd color new $img 0 0 255]

gd filledarc $img $blue 150 150 300 300 0 360
gd filledarc $img $red 100 100 50 50 0 360
gd filledarc $img $red 200 100 50 50 0 260
gd arc $img $red 150 0 300 300 90 180

gd returnPNG $img

gd destroy $img

would yield a PNG of a smiley face (more or less)

I'd like to thank Richard Kotal for sending me a number of bug fixes
and implementations of missing functionality. That spurred me on to
some additional coding and I can now report that nsgd supports
roughly 95% of the functionality of gd version 2.0.33.

There are a few things on which I would appreciate some feedback:

1. The current API is a jumble. Mostly I just went with the
"style" inherited from gdtclft. Thoughts on a more logical organizing
of the API are appreciated, particularly thoughts on using sub-
commands versus commands with tediously long names.

For example:
* gd color new vs. gd newColor
* gd filledpoygon, gd polygon, gd openpolygon vs. gd
polygon open, gd polygon fill, gd polygon (or maybe something like gd
polygon -fill)

2. Thoughts on how to code things so that images can be put into
nsv's. I haven't looked at it in depth, so maybe it's simple, but I
think it would be an important addition.

A few other random things from the TODO file: integrating with
nsgdchart (ok, you can "integrate" now---nsgdchart writes graphs to
files and then you can use nsgd commands to read the files in and
manipulate them further), autoconf the makefile, configuring font
path (and other things?) via ns_section/ns_param, ...

Matt

P.S. The on-line demos mentioned in the documentation aren't on-line.
As soon as I have a chance to put together something moderately
impressive, I will get it on-line and update the docs.

[1] http://cvs.sourceforge.net/viewcvs.py/aolserver/nsgd/


Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com