[libpng16] Imported from libpng-1.6.0beta20.tar

This commit is contained in:
Glenn Randers-Pehrson
2012-03-29 06:15:55 -05:00
parent 58f277c18e
commit 96027d919f
17 changed files with 54 additions and 43 deletions

View File

@@ -417,6 +417,8 @@ write_png(FILE *fp, int color_type, int bit_depth,
return 1;
}
/* Allow benign errors so that we can write PNGs with errors */
png_set_benign_errors(png_ptr, 1/*allowed*/);
png_init_io(png_ptr, fp);
info_ptr = png_create_info_struct(png_ptr);

View File

@@ -44,17 +44,18 @@ read_one_file(FILE *ip, const char *name)
return 0;
/* Success */
printf("{ 0x%8.8lx, 0x%8.8lx, "
"0x%2.2x%2.2x%2.2x%2.2x, 0x%2.2x%2.2x%2.2x%2.2x, "
"0x%2.2x%2.2x%2.2x%2.2x, 0x%2.2x%2.2x%2.2x%2.2x,\n"
" \"%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d\", %lu, \"%s\" },\n",
printf("PNG_ICC_CHECKSUM(0x%8.8lx, 0x%8.8lx,\n PNG_MD5("
"0x%2.2x%2.2x%2.2x%2.2x, 0x%2.2x%2.2x%2.2x%2.2x, 0x%2.2x%2.2x%2.2x%2.2x,"
" 0x%2.2x%2.2x%2.2x%2.2x), %d,\n"
" \"%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d\", %lu, \"%s\")\n",
(unsigned long)a32, (unsigned long)c32,
header[84], header[85], header[86], header[87],
header[88], header[89], header[90], header[91],
header[92], header[93], header[94], header[95],
header[96], header[97], header[98], header[99],
# define u16(x) (header[x] * 256 + header[x+1])
u16(24), u16(26), u16(28), u16(30), u16(32), u16(34),
# define u32(x) (u16(x) * 65536 + u16(x+2))
u32(64), u16(24), u16(26), u16(28), u16(30), u16(32), u16(34),
(unsigned long)length, name);
return 1;
@@ -64,8 +65,7 @@ int main(int argc, char **argv)
{
int err = 0;
printf("= {\n/* adler32 crc32 MD5\n"
" date length name */\n");
printf("/* adler32, crc32, MD5[16], intent, date, length, file-name */\n");
if (argc > 1)
{
@@ -80,7 +80,7 @@ int main(int argc, char **argv)
err = 1;
perror(argv[i]);
fprintf(stderr, "%s: read error\n", argv[i]);
printf(" { 0, 0, 0, /* ERROR: */, \"%s\" },\n", argv[i]);
printf("/* ERROR: %s */\n", argv[i]);
}
(void)fclose(ip);
@@ -94,11 +94,9 @@ int main(int argc, char **argv)
err = 1;
perror("stdin");
fprintf(stderr, "stdin: read error\n");
printf(" { 0, 0, 0, /* ERROR: */, \"-\" },\n");
printf("/* ERROR: stdin */\n");
}
}
printf("};\n");
return err;
}