Use default instead of best compression for PNG images.
authorMichel Dänzer <daenzer@vmware.com>
Thu, 24 Feb 2011 17:20:51 +0000 (09:20 -0800)
committerJosé Fonseca <jose.r.fonseca@gmail.com>
Wed, 23 Mar 2011 23:33:20 +0000 (23:33 +0000)
Should use about the same amount of space but significantly fewer CPU cycles.

image.cpp

index a42a78d..937f486 100644 (file)
--- a/image.cpp
+++ b/image.cpp
@@ -165,7 +165,7 @@ Image::writePNG(const char *filename) const {
     png_set_IHDR(png_ptr, info_ptr, width, height, 8, PNG_COLOR_TYPE_RGB_ALPHA,
         PNG_INTERLACE_NONE, PNG_COMPRESSION_TYPE_BASE, PNG_FILTER_TYPE_BASE);
 
-    png_set_compression_level(png_ptr, Z_BEST_COMPRESSION);
+    png_set_compression_level(png_ptr, Z_DEFAULT_COMPRESSION);
 
     png_write_info(png_ptr, info_ptr);