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 bug in Makefile
[swftools.git]
/
lib
/
png.c
diff --git
a/lib/png.c
b/lib/png.c
index
bcabd4c
..
35c1a25
100644
(file)
--- a/
lib/png.c
+++ b/
lib/png.c
@@
-1465,11
+1465,10
@@
static int png_find_best_filter(unsigned char*src, int width, int bpp, int y)
static int png_apply_filter(unsigned char*dest, unsigned char*src, int width, int y, int bpp)
{
static int png_apply_filter(unsigned char*dest, unsigned char*src, int width, int y, int bpp)
{
- make_num_bits_table();
-
- int num_filters = y>0?5:2; //don't apply y-direction filter in first line
int best_nr = 0;
#if 0
int best_nr = 0;
#if 0
+ make_num_bits_table();
+ int num_filters = y>0?5:2; //don't apply y-direction filter in first line
int f;
int best_energy = INT_MAX;
int w = width*(bpp/8);
int f;
int best_energy = INT_MAX;
int w = width*(bpp/8);
@@
-1514,11
+1513,11
@@
static int png_apply_filter(unsigned char*dest, unsigned char*src, int width, in
int png_apply_filter_8(unsigned char*dest, unsigned char*src, int width, int y)
{
int png_apply_filter_8(unsigned char*dest, unsigned char*src, int width, int y)
{
- png_apply_filter(dest, src, width, y, 8);
+ return png_apply_filter(dest, src, width, y, 8);
}
int png_apply_filter_32(unsigned char*dest, unsigned char*src, int width, int y)
{
}
int png_apply_filter_32(unsigned char*dest, unsigned char*src, int width, int y)
{
- png_apply_filter(dest, src, width, y, 32);
+ return png_apply_filter(dest, src, width, y, 32);
}
EXPORT void savePNG(const char*filename, unsigned char*data, int width, int height, int numcolors)
}
EXPORT void savePNG(const char*filename, unsigned char*data, int width, int height, int numcolors)
@@
-1529,8
+1528,6
@@
EXPORT void savePNG(const char*filename, unsigned char*data, int width, int heig
unsigned char format;
unsigned char tmp;
unsigned char* data2=0;
unsigned char format;
unsigned char tmp;
unsigned char* data2=0;
- u32 datalen;
- u32 datalen2;
unsigned char head[] = {137,80,78,71,13,10,26,10}; // PNG header
int cols;
char alpha = 1;
unsigned char head[] = {137,80,78,71,13,10,26,10}; // PNG header
int cols;
char alpha = 1;
@@
-1567,8
+1564,6
@@
EXPORT void savePNG(const char*filename, unsigned char*data, int width, int heig
png_quantize_image(data, width*height, numcolors, &data, palette);
}
png_quantize_image(data, width*height, numcolors, &data, palette);
}
- datalen = (width*height*bpp/8+cols*8);
-
fi = fopen(filename, "wb");
if(!fi) {
perror("open");
fi = fopen(filename, "wb");
if(!fi) {
perror("open");