[Mapserver-users] Re: sending image with mod_perl (conclusion)

Lowell Filak lfilak at medinaco.org
Fri Mar 7 12:16:46 PST 2003


Three cheers for Jason!

The following message was sent by Jason Thaxter <thaxter at gomoos.org> on Fri, 7 Mar 2003 12:18:52 -0500.

> A quick re-summary of the issue: under mod_perl, stdout does not go to the
> browser/client, it goes to wherever Apache thinks stdout is for itself.  So
> 	$img->saveImage(undef,
> doesn't really work, though it may sometimes accidentally work, depending on
> buffering issues.
> 
> So the solution is:
> 
> 	1) extend mapserver code to add a "writeImage" function that takes a
> 	filehandle instead of a file name.
> 
> 	2) extend the Perl interface through SWIG so perl can give the map object
> 	a filehandle to write the image on
> 
> 	3) in perl code, get a filehandle to the browser/client and pass it to the
> 	writeImage function.
> 
> Attached you will find a patch against 3.6.4 for parts 1 and 2, and a very
> minimal example in perl of how to accomplish part 3.  Maybe the execution
> could be better, and GD-like behavior (e.g. "print $img->png"), would be more
> elegant for the user, but this works now.
> 
> Hope this helps.  I'll copy this to the dev list later...
> 
> Cheers,
> Jason
> 
> -- 
> ----------------------------------------------
> Jason Thaxter
> GoMOOS, P.O. Box 4919, Portland, ME 04112-4919
> Office Location: 1 Canal Plaza, 7th Floor
> Office: 207.773.0423
> Fax:    207.773.8672
> Email:  thaxter at gomoos.org
> ------------www.gomoos.org--------------------
> 




More information about the MapServer-users mailing list