From ba1a8451bf2054193a8215995e1edb1d4661e0e2 Mon Sep 17 00:00:00 2001 From: Erik Reckase Date: Sun, 21 Nov 2010 13:50:22 +0000 Subject: png_set_swap must be called after the png_write_info call, otherwise it doesn't work. Would have been nice if this was documented a bit better. No more brute force byte swapping! git-svn-id: https://flam3.googlecode.com/svn/trunk@90 77852712-ef1d-11de-8684-7d64432d61a3 --- src/png.c | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/src/png.c b/src/png.c index 8eee7c7..23ff489 100755 --- a/src/png.c +++ b/src/png.c @@ -99,31 +99,21 @@ void write_png(FILE *file, void *image, int width, int height, flam3_img_comment PNG_COMPRESSION_TYPE_BASE, PNG_FILTER_TYPE_BASE); - /* Swap the bytes if we're doing 16bpc and on little-endian platform */ - if (2==bpc && testbe != htons(testbe)) { - unsigned short *im = (unsigned short *)image; - for (i=0; i