Opened 20 years ago

Last modified 16 years ago

#764 new enhancement

Loading pixel-based symbols from a URL

Reported by: sdlime Owned by: sdlime
Priority: high Milestone: FUTURE
Component: MapServer C Library Version: svn-trunk (development)
Severity: minor Keywords:
Cc:

Description (last modified by sdlime)

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/

Change History (1)

comment:1 by sdlime, 16 years ago

Description: modified (diff)
Milestone: FUTURE
Version: unspecifiedsvn-trunk (development)

We're already using libcurl for other things, why not loading an image?

Steve

Note: See TracTickets for help on using tickets.