Opened 15 years ago

Closed 15 years ago

Last modified 15 years ago

#3048 closed defect (fixed)

msIO_getStdoutBufferBytes(), gdBuffer in mapscript perl

Reported by: dmorissette Owned by: tomkralidis
Priority: normal Milestone: 5.6 release
Component: MapScript-Perl Version: 5.0
Severity: normal Keywords:
Cc: sdlime

Description

Felipe Alcacibar wrote to mapserver-users on 2009-04-09:

Hi, i'm trying to implement a wms server with a perl api of mapscript but i cannot understand how msIO_getStdoutBufferBytes() work in the docs msIO_getStdoutBufferBytes() function return the binary content of the current output but i cannot see that, when i dump with Data::Dump::Streamer i got:

-> $_p_gdBuffer1 = bless( \do { my $v = 152646680 }, '_p_gdBuffer' );

I go to read the sources of the mapscript perl implementation and i found a struct with properties data and size, but i cannot get that i got that when i try to dump data.

-> Can't locate object method "data" via package "_p_gdBuffer" at
/home/counter/mscacherd/maptest.pl line 36.

How it works in perl, how i can get the data from the gdBuffer perl class?

Thanks in advice. Greetings

Felipe

sorry, i forget that:

This is the version i use, i'm on gentoo linux

Perl> use mapscript;
Perl> print mapscript::msGetVersion();
MapServer version 5.0.0 OUTPUT=GIF OUTPUT=PNG OUTPUT=JPEG OUTPUT=WBMP
OUTPUT=PDF OUTPUT=SWF OUTPUT=SVG SUPPORTS=PROJ SUPPORTS=AGG
SUPPORTS=FREETYPE SUPPORTS=WMS_SERVER SUPPORTS=WMS_CLIENT
SUPPORTS=WFS_SERVER SUPPORTS=WFS_CLIENT SUPPORTS=WCS_SERVER
SUPPORTS=SOS_SERVER SUPPORTS=THREADS SUPPORTS=GEOS INPUT=EPPL7
INPUT=POSTGIS INPUT=OGR INPUT=GDAL INPUT=SHAPEFILE1
Perl> print mapscript::msGetVersionInt();
500001
Perl> exit

Attachments (1)

mapserver_mapscript_perl_gdbuffer_bytes.patch (1.1 KB ) - added by dmorissette 15 years ago.

Download all attachments as: .zip

Change History (5)

comment:1 by dmorissette, 15 years ago

Cc: sdlime added

Just a guess since I'm not very familiar with the Perl SWIG stuff, but maybe the patch from ticket #2962 could help?

If I'm not mistaken it solves a similar problem with the imageObj.getBytes return value, and I presume the problem you encountered needs a similar solution.

comment:2 by dmorissette, 15 years ago

On 2009-06-09, Felipe Alcacibar wrote to mapserver-users:

i found this thread in my mail, and i have solutioned this, i made a patch.here is the url:

http://counter.tryer.cl/mapserver/mapserver_mapscript_perl_gdbuffer_bytes.patch

comment:3 by dmorissette, 15 years ago

Resolution: fixed
Status: newclosed

Andy Colson confirmed on the mapserver-dev list that this problem is fixed in trunk (presumably by the gdBuffer typemap added in r8847 for ticket #2962):

-------- Original Message --------
Subject: [mapserver-dev] mapserver 5.6.0 testing
Date: Fri, 28 Aug 2009 10:11:24 -0500
From: Andy Colson <andy@squeakycode.net>
To: mapserver-dev@lists.osgeo.org

Wanted to send in a report... everything looks good.

I checked out trunk yesterday to test it out.  (the version reports 
itself as 5.5.0)

I'm using perl mapscript, and good news, it works out of the box with 
one small code change!

I was using this patch to make perl work:

http://trac.osgeo.org/mapserver/ticket/3048

and then use this perl code:

print mapscript::msIO_getStdoutBufferBytes();


For 5.5.0 (and above I hope), no patch is needed, and I changed to this 
code:

$x = mapscript::msIO_getStdoutBufferBytes();
print $$x;

No other changes were necessary.  The map rendering looks the same.  I 
am looking forward to the next version!

Thanks all to a great program.

-Andy

comment:4 by dmorissette, 15 years ago

Milestone: 6.0 release5.6.0 release
Note: See TracTickets for help on using tickets.