fix 1/2/4-bit png to filter bytes before decoding to pixels;
rename pngsuite/part1 to pngsuite/primary; check in pngsuite
@ -7,7 +7,7 @@
|
||||
#define STB_DEFINE
|
||||
#include "stb.h"
|
||||
|
||||
#define PART1
|
||||
#define PNGSUITE_PRIMARY
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
@ -34,8 +34,8 @@ int main(int argc, char **argv)
|
||||
}
|
||||
} else {
|
||||
int i, nope=0;
|
||||
#ifdef PART1
|
||||
char **files = stb_readdir_files("pngsuite/part1");
|
||||
#ifdef PNGSUITE_PRIMARY
|
||||
char **files = stb_readdir_files("pngsuite/primary");
|
||||
#else
|
||||
char **files = stb_readdir_files("images");
|
||||
#endif
|
||||
@ -43,7 +43,7 @@ int main(int argc, char **argv)
|
||||
int n;
|
||||
char **failed = NULL;
|
||||
unsigned char *data;
|
||||
//printf("%s\n", files[i]);
|
||||
printf("%s\n", files[i]);
|
||||
data = stbi_load(files[i], &w, &h, &n, 0); if (data) free(data); else stb_arr_push(failed, "&n");
|
||||
data = stbi_load(files[i], &w, &h, 0, 1); if (data) free(data); else stb_arr_push(failed, "1");
|
||||
data = stbi_load(files[i], &w, &h, 0, 2); if (data) free(data); else stb_arr_push(failed, "2");
|
||||
@ -52,16 +52,22 @@ int main(int argc, char **argv)
|
||||
if (data) {
|
||||
char fname[512];
|
||||
|
||||
#ifdef PART1
|
||||
#ifdef PNGSUITE_PRIMARY
|
||||
int w2,h2;
|
||||
unsigned char *data2;
|
||||
stb_splitpath(fname, files[i], STB_FILE_EXT);
|
||||
data2 = stbi_load(stb_sprintf("pngsuite/part1_check/%s", fname), &w2, &h2, 0, 4);
|
||||
data2 = stbi_load(stb_sprintf("pngsuite/primary_check/%s", fname), &w2, &h2, 0, 4);
|
||||
if (!data2)
|
||||
printf("FAILED: couldn't load 'pngsuite/part1_check/%s\n", fname);
|
||||
printf("FAILED: couldn't load 'pngsuite/primary_check/%s\n", fname);
|
||||
else {
|
||||
if (w != w2 || h != w2 || 0 != memcmp(data, data2, w*h*4)) {
|
||||
printf("FAILED: %s loaded but didn't match part1_check 32-bit version\n", files[i]);
|
||||
int x,y,c;
|
||||
if (w == w2 && h == h2)
|
||||
for (y=0; y < h; ++y)
|
||||
for (x=0; x < w; ++x)
|
||||
for (c=0; c < 4; ++c)
|
||||
assert(data[y*w*4+x*4+c] == data2[y*w*4+x*4+c]);
|
||||
printf("FAILED: %s loaded but didn't match PRIMARY_check 32-bit version\n", files[i]);
|
||||
}
|
||||
free(data2);
|
||||
}
|
||||
|
BIN
tests/pngsuite/16bit/basi0g16.png
Normal file
After Width: | Height: | Size: 299 B |
BIN
tests/pngsuite/16bit/basi2c16.png
Normal file
After Width: | Height: | Size: 595 B |
BIN
tests/pngsuite/16bit/basi4a16.png
Normal file
After Width: | Height: | Size: 2.8 KiB |
BIN
tests/pngsuite/16bit/basi6a16.png
Normal file
After Width: | Height: | Size: 4.1 KiB |
BIN
tests/pngsuite/16bit/basn0g16.png
Normal file
After Width: | Height: | Size: 167 B |
BIN
tests/pngsuite/16bit/basn2c16.png
Normal file
After Width: | Height: | Size: 302 B |
BIN
tests/pngsuite/16bit/basn4a16.png
Normal file
After Width: | Height: | Size: 2.2 KiB |
BIN
tests/pngsuite/16bit/basn6a16.png
Normal file
After Width: | Height: | Size: 3.4 KiB |
BIN
tests/pngsuite/16bit/bgai4a16.png
Normal file
After Width: | Height: | Size: 2.8 KiB |
BIN
tests/pngsuite/16bit/bgan6a16.png
Normal file
After Width: | Height: | Size: 3.4 KiB |
BIN
tests/pngsuite/16bit/bggn4a16.png
Normal file
After Width: | Height: | Size: 2.2 KiB |
BIN
tests/pngsuite/16bit/bgyn6a16.png
Normal file
After Width: | Height: | Size: 3.4 KiB |
BIN
tests/pngsuite/16bit/oi1n0g16.png
Normal file
After Width: | Height: | Size: 167 B |
BIN
tests/pngsuite/16bit/oi1n2c16.png
Normal file
After Width: | Height: | Size: 302 B |
BIN
tests/pngsuite/16bit/oi2n0g16.png
Normal file
After Width: | Height: | Size: 179 B |
BIN
tests/pngsuite/16bit/oi2n2c16.png
Normal file
After Width: | Height: | Size: 314 B |
BIN
tests/pngsuite/16bit/oi4n0g16.png
Normal file
After Width: | Height: | Size: 203 B |
BIN
tests/pngsuite/16bit/oi4n2c16.png
Normal file
After Width: | Height: | Size: 338 B |
BIN
tests/pngsuite/16bit/oi9n0g16.png
Normal file
After Width: | Height: | Size: 1.3 KiB |
BIN
tests/pngsuite/16bit/oi9n2c16.png
Normal file
After Width: | Height: | Size: 3.0 KiB |
BIN
tests/pngsuite/16bit/tbbn2c16.png
Normal file
After Width: | Height: | Size: 2.0 KiB |
BIN
tests/pngsuite/16bit/tbgn2c16.png
Normal file
After Width: | Height: | Size: 2.0 KiB |
BIN
tests/pngsuite/16bit/tbwn0g16.png
Normal file
After Width: | Height: | Size: 1.3 KiB |
9
tests/pngsuite/PngSuite.LICENSE
Normal file
@ -0,0 +1,9 @@
|
||||
PngSuite
|
||||
--------
|
||||
|
||||
Permission to use, copy, modify and distribute these images for any
|
||||
purpose and without fee is hereby granted.
|
||||
|
||||
|
||||
(c) Willem van Schaik, 1996, 2011
|
||||
|
BIN
tests/pngsuite/corrupt/xc1n0g08.png
Normal file
After Width: | Height: | Size: 138 B |
BIN
tests/pngsuite/corrupt/xc9n2c08.png
Normal file
After Width: | Height: | Size: 145 B |
BIN
tests/pngsuite/corrupt/xcrn0g04.png
Normal file
BIN
tests/pngsuite/corrupt/xcsn0g01.png
Normal file
After Width: | Height: | Size: 164 B |
BIN
tests/pngsuite/corrupt/xd0n2c08.png
Normal file
After Width: | Height: | Size: 145 B |
BIN
tests/pngsuite/corrupt/xd3n2c08.png
Normal file
After Width: | Height: | Size: 145 B |
BIN
tests/pngsuite/corrupt/xd9n2c08.png
Normal file
After Width: | Height: | Size: 145 B |
BIN
tests/pngsuite/corrupt/xdtn0g01.png
Normal file
After Width: | Height: | Size: 61 B |
BIN
tests/pngsuite/corrupt/xhdn0g08.png
Normal file
After Width: | Height: | Size: 138 B |
BIN
tests/pngsuite/corrupt/xlfn0g04.png
Normal file
BIN
tests/pngsuite/corrupt/xs1n0g01.png
Normal file
BIN
tests/pngsuite/corrupt/xs2n0g01.png
Normal file
BIN
tests/pngsuite/corrupt/xs4n0g01.png
Normal file
BIN
tests/pngsuite/corrupt/xs7n0g01.png
Normal file
BIN
tests/pngsuite/primary/basi0g01.png
Normal file
After Width: | Height: | Size: 217 B |
BIN
tests/pngsuite/primary/basi0g02.png
Normal file
After Width: | Height: | Size: 154 B |
BIN
tests/pngsuite/primary/basi0g04.png
Normal file
After Width: | Height: | Size: 247 B |
BIN
tests/pngsuite/primary/basi0g08.png
Normal file
After Width: | Height: | Size: 254 B |
BIN
tests/pngsuite/primary/basi2c08.png
Normal file
After Width: | Height: | Size: 315 B |
BIN
tests/pngsuite/primary/basi3p01.png
Normal file
After Width: | Height: | Size: 132 B |
BIN
tests/pngsuite/primary/basi3p02.png
Normal file
After Width: | Height: | Size: 193 B |
BIN
tests/pngsuite/primary/basi3p04.png
Normal file
After Width: | Height: | Size: 327 B |
BIN
tests/pngsuite/primary/basi3p08.png
Normal file
After Width: | Height: | Size: 1.5 KiB |
BIN
tests/pngsuite/primary/basi4a08.png
Normal file
After Width: | Height: | Size: 214 B |
BIN
tests/pngsuite/primary/basi6a08.png
Normal file
After Width: | Height: | Size: 361 B |
BIN
tests/pngsuite/primary/basn0g01.png
Normal file
After Width: | Height: | Size: 164 B |
BIN
tests/pngsuite/primary/basn0g02.png
Normal file
After Width: | Height: | Size: 104 B |
BIN
tests/pngsuite/primary/basn0g04.png
Normal file
After Width: | Height: | Size: 145 B |
BIN
tests/pngsuite/primary/basn0g08.png
Normal file
After Width: | Height: | Size: 138 B |
BIN
tests/pngsuite/primary/basn2c08.png
Normal file
After Width: | Height: | Size: 145 B |
BIN
tests/pngsuite/primary/basn3p01.png
Normal file
After Width: | Height: | Size: 112 B |
BIN
tests/pngsuite/primary/basn3p02.png
Normal file
After Width: | Height: | Size: 146 B |
BIN
tests/pngsuite/primary/basn3p04.png
Normal file
After Width: | Height: | Size: 216 B |
BIN
tests/pngsuite/primary/basn3p08.png
Normal file
After Width: | Height: | Size: 1.3 KiB |
BIN
tests/pngsuite/primary/basn4a08.png
Normal file
After Width: | Height: | Size: 126 B |
BIN
tests/pngsuite/primary/basn6a08.png
Normal file
After Width: | Height: | Size: 184 B |
BIN
tests/pngsuite/primary/bgai4a08.png
Normal file
After Width: | Height: | Size: 214 B |
BIN
tests/pngsuite/primary/bgan6a08.png
Normal file
After Width: | Height: | Size: 184 B |
BIN
tests/pngsuite/primary/bgbn4a08.png
Normal file
After Width: | Height: | Size: 140 B |
BIN
tests/pngsuite/primary/bgwn6a08.png
Normal file
After Width: | Height: | Size: 202 B |
BIN
tests/pngsuite/primary/s01i3p01.png
Normal file
After Width: | Height: | Size: 113 B |
BIN
tests/pngsuite/primary/s01n3p01.png
Normal file
After Width: | Height: | Size: 113 B |
BIN
tests/pngsuite/primary/s02i3p01.png
Normal file
After Width: | Height: | Size: 114 B |
BIN
tests/pngsuite/primary/s02n3p01.png
Normal file
After Width: | Height: | Size: 115 B |
BIN
tests/pngsuite/primary/s03i3p01.png
Normal file
After Width: | Height: | Size: 118 B |
BIN
tests/pngsuite/primary/s03n3p01.png
Normal file
After Width: | Height: | Size: 120 B |
BIN
tests/pngsuite/primary/s04i3p01.png
Normal file
After Width: | Height: | Size: 126 B |
BIN
tests/pngsuite/primary/s04n3p01.png
Normal file
After Width: | Height: | Size: 121 B |
BIN
tests/pngsuite/primary/s05i3p02.png
Normal file
After Width: | Height: | Size: 134 B |
BIN
tests/pngsuite/primary/s05n3p02.png
Normal file
After Width: | Height: | Size: 129 B |
BIN
tests/pngsuite/primary/s06i3p02.png
Normal file
After Width: | Height: | Size: 143 B |
BIN
tests/pngsuite/primary/s06n3p02.png
Normal file
After Width: | Height: | Size: 131 B |
BIN
tests/pngsuite/primary/s07i3p02.png
Normal file
After Width: | Height: | Size: 149 B |
BIN
tests/pngsuite/primary/s07n3p02.png
Normal file
After Width: | Height: | Size: 138 B |
BIN
tests/pngsuite/primary/s08i3p02.png
Normal file
After Width: | Height: | Size: 149 B |
BIN
tests/pngsuite/primary/s08n3p02.png
Normal file
After Width: | Height: | Size: 139 B |
BIN
tests/pngsuite/primary/s09i3p02.png
Normal file
After Width: | Height: | Size: 147 B |
BIN
tests/pngsuite/primary/s09n3p02.png
Normal file
After Width: | Height: | Size: 143 B |
BIN
tests/pngsuite/primary/s32i3p04.png
Normal file
After Width: | Height: | Size: 355 B |
BIN
tests/pngsuite/primary/s32n3p04.png
Normal file
After Width: | Height: | Size: 263 B |
BIN
tests/pngsuite/primary/s33i3p04.png
Normal file
After Width: | Height: | Size: 385 B |
BIN
tests/pngsuite/primary/s33n3p04.png
Normal file
After Width: | Height: | Size: 329 B |
BIN
tests/pngsuite/primary/s34i3p04.png
Normal file
After Width: | Height: | Size: 349 B |
BIN
tests/pngsuite/primary/s34n3p04.png
Normal file
After Width: | Height: | Size: 248 B |
BIN
tests/pngsuite/primary/s35i3p04.png
Normal file
After Width: | Height: | Size: 399 B |
BIN
tests/pngsuite/primary/s35n3p04.png
Normal file
After Width: | Height: | Size: 338 B |
BIN
tests/pngsuite/primary/s36i3p04.png
Normal file
After Width: | Height: | Size: 356 B |
BIN
tests/pngsuite/primary/s36n3p04.png
Normal file
After Width: | Height: | Size: 258 B |
BIN
tests/pngsuite/primary/s37i3p04.png
Normal file
After Width: | Height: | Size: 393 B |
BIN
tests/pngsuite/primary/s37n3p04.png
Normal file
After Width: | Height: | Size: 336 B |
BIN
tests/pngsuite/primary/s38i3p04.png
Normal file
After Width: | Height: | Size: 357 B |
BIN
tests/pngsuite/primary/s38n3p04.png
Normal file
After Width: | Height: | Size: 245 B |
BIN
tests/pngsuite/primary/s39i3p04.png
Normal file
After Width: | Height: | Size: 420 B |
BIN
tests/pngsuite/primary/s39n3p04.png
Normal file
After Width: | Height: | Size: 352 B |
BIN
tests/pngsuite/primary/s40i3p04.png
Normal file
After Width: | Height: | Size: 357 B |