[mapserver-commits] r10996 - trunk/mapserver

svn at osgeo.org svn at osgeo.org
Wed Feb 16 16:34:10 EST 2011


Author: warmerdam
Date: 2011-02-16 13:34:10 -0800 (Wed, 16 Feb 2011)
New Revision: 10996

Modified:
   trunk/mapserver/mapimageio.c
Log:
preliminary support for msIO api at least for writing directly to jpeg and png (#3694)

Modified: trunk/mapserver/mapimageio.c
===================================================================
--- trunk/mapserver/mapimageio.c	2011-02-16 21:18:56 UTC (rev 10995)
+++ trunk/mapserver/mapimageio.c	2011-02-16 21:34:10 UTC (rev 10996)
@@ -46,7 +46,7 @@
 
 void png_write_data_to_stream(png_structp png_ptr, png_bytep data, png_size_t length) {
     FILE *fp = ((streamInfo*)png_get_io_ptr(png_ptr))->fp;
-    fwrite(data,length,1,fp);
+    msIO_fwrite(data,length,1,fp);
 }
 
 void png_write_data_to_buffer(png_structp png_ptr, png_bytep data, png_size_t length) {
@@ -90,7 +90,7 @@
 
 void jpeg_stream_term_destination (j_compress_ptr cinfo) {
     ms_stream_destination_mgr *dest = (ms_stream_destination_mgr*) cinfo->dest;
-    fwrite(dest->mgr.data, OUTPUT_BUF_SIZE-dest->mgr.pub.free_in_buffer, 1, dest->stream);
+    msIO_fwrite(dest->mgr.data, OUTPUT_BUF_SIZE-dest->mgr.pub.free_in_buffer, 1, dest->stream);
     dest->mgr.pub.next_output_byte = dest->mgr.data;
     dest->mgr.pub.free_in_buffer = OUTPUT_BUF_SIZE;
 }
@@ -104,7 +104,7 @@
 
 int jpeg_stream_empty_output_buffer (j_compress_ptr cinfo) {
     ms_stream_destination_mgr *dest = (ms_stream_destination_mgr*) cinfo->dest;
-    fwrite(dest->mgr.data, OUTPUT_BUF_SIZE, 1, dest->stream);
+    msIO_fwrite(dest->mgr.data, OUTPUT_BUF_SIZE, 1, dest->stream);
     dest->mgr.pub.next_output_byte = dest->mgr.data;
     dest->mgr.pub.free_in_buffer = OUTPUT_BUF_SIZE;
     return TRUE;
@@ -542,7 +542,7 @@
   fileIOCtx *fctx;
   fctx = (fileIOCtx *) ctx;
 
-  return (fread (buf, 1, size, fctx->f));
+  return (msIO_fread (buf, 1, size, fctx->f));
 
 }
 



More information about the mapserver-commits mailing list