Author: jmb
Date: Thu Sep 17 07:38:00 2009
New Revision: 9588
URL:
http://source.netsurf-browser.org?rev=9588&view=rev
Log:
Calculate percentage relative to 32bpp buffer, rather than uncompressed source data.
Modified:
trunk/libnspng/test/pngread.c
Modified: trunk/libnspng/test/pngread.c
URL:
http://source.netsurf-browser.org/trunk/libnspng/test/pngread.c?rev=9588&...
==============================================================================
--- trunk/libnspng/test/pngread.c (original)
+++ trunk/libnspng/test/pngread.c Thu Sep 17 07:38:00 2009
@@ -121,14 +121,14 @@
fseek(fp, 0, SEEK_END);
long fsize = ftell(fp);
- full += ctx->image.height * ctx->image.bytes_per_scanline;
+ full += ctx->image.height * ctx->image.width * 4;
comp += ctx->image.data_len;
printf("%s: %lu (%u) -> %u = %.2f%%\n", argv[i], fsize,
- ctx->image.height * ctx->image.bytes_per_scanline,
+ ctx->image.height * ctx->image.width * 4,
ctx->image.data_len,
(float) ctx->image.data_len * 100 /
- (float) (ctx->image.height * ctx->image.bytes_per_scanline));
+ (float) (ctx->image.height * ctx->image.width * 4));
nspng_ctx_destroy(ctx);