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

svn at osgeo.org svn at osgeo.org
Mon Sep 12 04:27:58 EDT 2011


Author: tbonfort
Date: 2011-09-12 01:27:58 -0700 (Mon, 12 Sep 2011)
New Revision: 12539

Modified:
   trunk/mapserver/mapcache/src/imageio_png.c
Log:
set png filter to PNG_FILTER_NONE (#4017)


Modified: trunk/mapserver/mapcache/src/imageio_png.c
===================================================================
--- trunk/mapserver/mapcache/src/imageio_png.c	2011-09-12 07:35:57 UTC (rev 12538)
+++ trunk/mapserver/mapcache/src/imageio_png.c	2011-09-12 08:27:58 UTC (rev 12539)
@@ -150,6 +150,11 @@
       ctx->set_error(ctx, 500, "failed to allocate png_struct structure");
       return NULL;
    }
+   if(compression == MAPCACHE_COMPRESSION_BEST)
+      png_set_compression_level (png_ptr, Z_BEST_COMPRESSION);
+   else if(compression == MAPCACHE_COMPRESSION_FAST)
+      png_set_compression_level (png_ptr, Z_BEST_SPEED);
+   png_set_filter(png_ptr,0,PNG_FILTER_NONE);
 
    info_ptr = png_create_info_struct(png_ptr);
    if (!info_ptr)
@@ -179,10 +184,6 @@
    png_set_IHDR(png_ptr, info_ptr, img->w, img->h,
          8, color_type, PNG_INTERLACE_NONE,
          PNG_COMPRESSION_TYPE_DEFAULT, PNG_FILTER_TYPE_DEFAULT);
-   if(compression == MAPCACHE_COMPRESSION_BEST)
-      png_set_compression_level (png_ptr, Z_BEST_COMPRESSION);
-   else if(compression == MAPCACHE_COMPRESSION_FAST)
-      png_set_compression_level (png_ptr, Z_BEST_SPEED);
 
    png_write_info(png_ptr, info_ptr);
    if(color_type == PNG_COLOR_TYPE_RGB)
@@ -1032,6 +1033,11 @@
    if (!png_ptr)
       return (NULL);
 
+   if(compression == MAPCACHE_COMPRESSION_BEST)
+      png_set_compression_level (png_ptr, Z_BEST_COMPRESSION);
+   else if(compression == MAPCACHE_COMPRESSION_FAST)
+      png_set_compression_level (png_ptr, Z_BEST_SPEED);
+   png_set_filter(png_ptr,0,PNG_FILTER_NONE);
    info_ptr = png_create_info_struct(png_ptr);
    if (!info_ptr)
    {
@@ -1062,11 +1068,6 @@
          0, PNG_COMPRESSION_TYPE_DEFAULT,
          PNG_FILTER_TYPE_DEFAULT);
 
-   if(compression == MAPCACHE_COMPRESSION_BEST)
-      png_set_compression_level (png_ptr, Z_BEST_COMPRESSION);
-   else if(compression == MAPCACHE_COMPRESSION_FAST)
-      png_set_compression_level (png_ptr, Z_BEST_SPEED);
-   
    _mapcache_imageio_remap_palette(pixels, image->w * image->h, palette, numPaletteEntries,
          maxval,rgb,a,&num_a);
    



More information about the mapserver-commits mailing list