On Wed, 7 Jul 2004, Steve Lime wrote:
> Thomas: Sorry about any misunderstanding. Anyway, what is being asked
> for is a method to load an image into GD from a URL. I can add that to
> MapServer itself or perhaps that is a function that GD users in general
> might find useful, something like gdImageCreateFromUrl(...). Just a
> thought.
>
> For web mapping this would allow people to add their own marker symbols
> to mapping applications, stuff like that. Make more sense?
Possibly. You should look at gdImageCreateFromPngPtr, which can load
a png from a buffer in memory. You stll have to get hold of the
image, but a complete http/ftp/etc. implementation would be a rather
heavy thing to put into gd itself, not to mention a maintenance headache.
Usually the host application or language already has good facilities
for fetching URLs.
You can also use gdImageCreateFromPngCtx if you want to supply I/O
callback functions and avoid the memory overhead of reading the image
file into memory first, although it's usually nothing compared to the
overhead of the *uncompressed* image you'll have after you call
gdImageCreateFromPngPtr, so I tend to suggest that simpler approach.
--
Thomas Boutell
Boutell.Com, Inc.
http://www.boutell.com/