X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;ds=sidebyside;f=src%2Frrd_gfx.c;h=49b93685e7cc9931e3332d51281b8605570f311f;hb=3fe632c3c239f6e6cee2245e01b5e09a0082790f;hp=253c7a6378108d081447617c75ebe72377181317;hpb=963ea81c470181470ba8f3260c43d171fc403902;p=rrdtool.git diff --git a/src/rrd_gfx.c b/src/rrd_gfx.c index 253c7a6..49b9368 100644 --- a/src/rrd_gfx.c +++ b/src/rrd_gfx.c @@ -719,12 +719,19 @@ static int gfx_save_png (art_u8 *buffer, FILE *fp, long width, long height, lon text[0].compression = PNG_TEXT_COMPRESSION_NONE; png_set_text (png_ptr, info_ptr, text, 1); + /* lets make this fast */ + png_set_compression_level(png_ptr,1); + png_set_filter(png_ptr,PNG_FILTER_TYPE_BASE,PNG_NO_FILTERS); + /* + png_set_filter(png_ptr,PNG_FILTER_TYPE_BASE,PNG_FILTER_SUB); + png_set_compression_strategy(png_ptr,Z_HUFFMAN_ONLY); + png_set_compression_level(png_ptr,Z_BEST_SPEED); */ + /* Write header data */ png_write_info (png_ptr, info_ptr); - for (i = 0; i < height; i++) row_pointers[i] = (png_bytep) (buffer + i*rowstride); - + png_write_image(png_ptr, row_pointers); png_write_end(png_ptr, info_ptr); png_destroy_write_struct(&png_ptr, &info_ptr);