[mapserver-commits] r12240 - trunk/mapserver/mapcache/src

svn at osgeo.org svn at osgeo.org
Fri Aug 26 07:09:56 EDT 2011


Author: tbonfort
Date: 2011-08-26 04:09:55 -0700 (Fri, 26 Aug 2011)
New Revision: 12240

Modified:
   trunk/mapserver/mapcache/src/imageio_png.c
Log:
allow watermarks that are smaller than the exact tile image
thomas.bonfort | 2011-01-12 16:02:05 +0100 (Wed, 12 Jan 2011)

Modified: trunk/mapserver/mapcache/src/imageio_png.c
===================================================================
--- trunk/mapserver/mapcache/src/imageio_png.c	2011-08-26 11:09:51 UTC (rev 12239)
+++ trunk/mapserver/mapcache/src/imageio_png.c	2011-08-26 11:09:55 UTC (rev 12240)
@@ -50,6 +50,7 @@
    _geocache_buffer_closure b;
    b.buffer = buffer;
    b.ptr = buffer->buf;
+   png_uint_32 width, height;
 
 
    /* could pass pointers to user-defined error handlers instead of NULLs: */
@@ -77,11 +78,13 @@
 
    png_read_info(png_ptr,info_ptr);
    img = geocache_image_create(ctx);
-   if(!png_get_IHDR(png_ptr, info_ptr, &img->w, &img->h,&bit_depth, &color_type,NULL,NULL,NULL)) {
+   if(!png_get_IHDR(png_ptr, info_ptr, &width, &height,&bit_depth, &color_type,NULL,NULL,NULL)) {
       ctx->set_error(ctx, GEOCACHE_IMAGE_ERROR, "failed to read png header");
       return NULL;
    }
 
+   img->w = width;
+   img->h = height;
    img->data = apr_pcalloc(ctx->pool,img->w*img->h*4*sizeof(unsigned char));
    img->stride = img->w * 4;
    row_pointers = apr_pcalloc(ctx->pool,img->h * sizeof(unsigned char*));



More information about the mapserver-commits mailing list