MapTools.org

[Chameleon] ImageObjects and gd images

Paul Spencer spencer@dmsolutions.ca
Fri, 07 Nov 2003 10:21:01 -0500
Huub,

AFAIK, even though the mapserver imageobj is a GD image, it is not 
compatible with the PHP GD image objects.  This is unfortunate, but 
something that is possible because they share a common data structure at 
some level in the code.  There is an existing bug in MapServer bugzilla,

http://mapserver.gis.umn.edu/bugs/show_bug.cgi?id=110

that discusses this issue.  Please contact me directly if you are 
interested in funding this work.  Otherwise, it will likely wait until 
someone either takes an interest in this issue or funds it.

Another suggestion is to create a layer with TRANSFORM FALSE, ensure 
that the image is transparent in the appropriate places for the map to 
show through, and then draw this layer last as a mask on top of the map. 
  You can then set the source for the layer to your PNG file and it 
should  work.

Cheers,

Paul

Huub Fleuren wrote:

> Hello
> 
> I would like to compose a final layout image from a drawn map and 
> scalebar image from the mapserver and a default layout, which is a PNG 
> on disk.
> 
> I found that a $layout_img gd image object create with
>    $layout_img=imagecreatefrompng("a4portrait.png");
> 
> is not the same as an imageobject create with mapscript like
>      $oImage = oMap->draw();
> 
> 
> A solution to this would be to save the map
> 
>    $szMapUrl = $oImage->saveWebImage("")
> 
> and read such file with gd to paste a new image together from diskfiles
> 
> 
> But i would rather paste the final layout with oMap->pasteImage 
> functionality.
> 
> This would be possible, if a MapScript imageObject coould be read from file
> 
> or i'm missing something: can a gd image be cast into a mapscript image 
> object?
> 
> 
> Greetings
> 
> Huub
> 
> 

-- 
  -----------------------------------------------------------------
|Paul Spencer                           spencer@dmsolutions.ca    |
|-----------------------------------------------------------------|
|Applications & Software Development                              |
|DM Solutions Group Inc                 http://www.dmsolutions.ca/|
  -----------------------------------------------------------------




This archive was generated by Pipermail.