[Mapserver-users] mapscript::msSaveImage error
Eric Bridger
eric at gomoos.org
Tue May 20 06:01:56 PDT 2003
You can also do:
my $ref_img = $map->drawReferenceMap();
# This should send PNG to stdout.
$ref_img->saveImage(undef, $mapscript::MS_PNG, $map->{transparent},
$map->{interlace}, 0);
On Tue, 2003-05-20 at 16:00, Babak Toloue Tehrani wrote:
> Hello,
>
> if you are using the development version (3.7, 4.0) try this:
>
> my $map = new $ref_img->saveImage($ref_image_name, $mapscript::MS_PNG, $map->{transparent}, $map->{interlace}, 0);
mapscript::mapObj("data/demo37.map") or die('Unable to
> OPEN mapfile.');
> my $img = $map->draw() or die('Unable to DRAW mapfile.');
> $img->save('test37.png');
> $img->free();
>
> on 3.6.x use:
>
> my $map = new mapscript::mapObj("data/demo365.map") or die('Unable to
> OPEN mapfile.');
> my $img = $map->draw() or die('Unable to DRAW mapfile.');
> $img->saveImage('testmap.png', $mapscript::MS_PNG,
> $map->{transparent},$map->{interlace}, 0);
> $img->free();
>
>
>
> Am Die, 2003-05-20 um 15.36 schrieb Pedro Salazar:
> > Greetings,
> >
> > I'm trying to return a image map in my perl mapscript. However, when I
> > use the procedure msSaveImage, I got an error on my map script log and
> > no image return on my perl script.
> >
> > This is my code:
> > "
> > my $ref_img = $map->drawReferenceMap();
> > mapscript::msSaveImage($ref_img,undef,$mapscript::MS_PNG,
> > $map->{transparent},$map->{interlace},undef);
> > "
> >
> > This is my error output:
> > "
> > Tue May 20 14:29:57 2003 - msSearchDiskTree(): Unable to access file.
> > Tue May 20 14:29:57 2003 - msSearchDiskTree(): Unable to access file.
> > Tue May 20 14:29:57 2003 - msDrawReferenceMap(): Unable to access file.
> > ((null))
> > "
> >
> > I managed a workaround to solve my problem doing this but I would like
> > to avoid this approach:
> > "
> > my $tmp_file="/tmp/".rand().".png";
> > $img->saveImage($tmp_file,$mapscript::MS_PNG, $map->{transparent},
> > $map->{interlace}, undef);
> > system("cat $tmp_file");
> > system("rm -f $tmp_file");
> > "
> >
> > So, I'm interested to know why is that happening (error) and how can I
> > solve it.
> >
> > Thanks for all your attention,
> > Pedro.
> --
> Babak Toloue Tehrani <babak.tehrani at geosysnet.de>
>
> _______________________________________________
> Mapserver-users mailing list
> Mapserver-users at lists.gis.umn.edu
> http://lists.gis.umn.edu/mailman/listinfo/mapserver-users
>
More information about the MapServer-users
mailing list