git.asbjorn.biz
/
swftools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fixed rescaling bug in fillgradient and addlink
[swftools.git]
/
lib
/
png.c
diff --git
a/lib/png.c
b/lib/png.c
index
e793367
..
e290b6f
100644
(file)
--- a/
lib/png.c
+++ b/
lib/png.c
@@
-197,6
+197,7
@@
static void applyfilter1(int mode, unsigned char*src, unsigned char*old, unsigne
else if(mode==3) {
for(x=0;x<width;x++) {
*dest = *src+(*old+last)/2;
else if(mode==3) {
for(x=0;x<width;x++) {
*dest = *src+(*old+last)/2;
+ last = *dest;
dest++;
old++;
src++;
dest++;
old++;
src++;
@@
-484,7
+485,6
@@
EXPORT int getPNG(const char*sname, int*destwidth, int*destheight, unsigned char
}
if(!png_read_header(fi, &header)) {
}
if(!png_read_header(fi, &header)) {
- printf("Error reading header from file %s\n", sname);
return 0;
}
return 0;
}
@@
-1082,7
+1082,7
@@
EXPORT void writePNG(const char*filename, unsigned char*data, int width, int hei
zs.opaque = Z_NULL;
zs.next_out = writebuf;
zs.avail_out = ZLIB_BUFFER_SIZE;
zs.opaque = Z_NULL;
zs.next_out = writebuf;
zs.avail_out = ZLIB_BUFFER_SIZE;
- ret = deflateInit(&zs, 9);
+ ret = deflateInit(&zs, Z_NO_COMPRESSION);
if (ret != Z_OK) {
fprintf(stderr, "error in deflateInit(): %s", zs.msg?zs.msg:"unknown");
return;
if (ret != Z_OK) {
fprintf(stderr, "error in deflateInit(): %s", zs.msg?zs.msg:"unknown");
return;
@@
-1100,7
+1100,7
@@
EXPORT void writePNG(const char*filename, unsigned char*data, int width, int hei
{
int filtermode;
int bestsize = 0x7fffffff;
{
int filtermode;
int bestsize = 0x7fffffff;
- for(filtermode=0;filtermode<5;filtermode++) {
+ for(filtermode=0;filtermode<=0;filtermode++) {
if(!y && filtermode>=2)
continue; // don't do y direction filters in the first row
if(!y && filtermode>=2)
continue; // don't do y direction filters in the first row