[Gdal-dev] no file

Frank Warmerdam warmerdam at pobox.com
Tue Mar 31 11:37:01 EDT 2009


mjollnir wrote:
> hi,
> 
> i read the image from a JPG file, and translate it to a PNG dataset, now, i
> want send the PNG image binary data to a socket directly, actually no
> intermediate PNG file needed.

Ray,

You can run the PNG encoder to a memory buffer "virtual file" using the
mechanism described at:

   http://www.gdal.org/cpl__vsi_8h.html#66e2e6f093fd42f8a941b962d4c8a19e

Then you would send the contents of the memory buffer off to the socket.

In theory you could also write a special file handler allowing you to
stream it directly to the socket without an intermediate memory buffer but
that would be very involved.

Best regards,
-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent



More information about the gdal-dev mailing list