png.c: Use palette for file size savings
Before Width: | Height: | Size: 365 B After Width: | Height: | Size: 178 B |
Before Width: | Height: | Size: 520 B After Width: | Height: | Size: 220 B |
Before Width: | Height: | Size: 549 B After Width: | Height: | Size: 235 B |
Before Width: | Height: | Size: 366 B After Width: | Height: | Size: 151 B |
Before Width: | Height: | Size: 901 B After Width: | Height: | Size: 434 B |
Before Width: | Height: | Size: 1,002 B After Width: | Height: | Size: 488 B |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 545 B |
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 584 B |
Before Width: | Height: | Size: 647 B After Width: | Height: | Size: 236 B |
Before Width: | Height: | Size: 299 B After Width: | Height: | Size: 155 B |
Before Width: | Height: | Size: 454 B After Width: | Height: | Size: 219 B |
Before Width: | Height: | Size: 745 B After Width: | Height: | Size: 344 B |
Before Width: | Height: | Size: 865 B After Width: | Height: | Size: 392 B |
Before Width: | Height: | Size: 934 B After Width: | Height: | Size: 411 B |
Before Width: | Height: | Size: 1 KiB After Width: | Height: | Size: 470 B |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 518 B |
Before Width: | Height: | Size: 392 B After Width: | Height: | Size: 193 B |
BIN
backend/tests/data/png/pdf417_bgfgalpha.png
Normal file
After Width: | Height: | Size: 194 B |
Before Width: | Height: | Size: 395 B After Width: | Height: | Size: 192 B |
Before Width: | Height: | Size: 350 B After Width: | Height: | Size: 150 B |
Before Width: | Height: | Size: 305 B |
BIN
backend/tests/data/png/ultra_bgalpha.png
Normal file
After Width: | Height: | Size: 223 B |
BIN
backend/tests/data/png/ultra_bgfgalpha.png
Normal file
After Width: | Height: | Size: 231 B |
BIN
backend/tests/data/png/ultra_fgalpha.png
Normal file
After Width: | Height: | Size: 230 B |
BIN
backend/tests/data/png/ultra_fgalpha_nobg.png
Normal file
After Width: | Height: | Size: 220 B |
Before Width: | Height: | Size: 941 B After Width: | Height: | Size: 442 B |
Before Width: | Height: | Size: 910 B After Width: | Height: | Size: 460 B |
Before Width: | Height: | Size: 904 B After Width: | Height: | Size: 460 B |
Before Width: | Height: | Size: 424 B After Width: | Height: | Size: 167 B |
Before Width: | Height: | Size: 1 KiB After Width: | Height: | Size: 515 B |
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 579 B |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 581 B |
Before Width: | Height: | Size: 657 B After Width: | Height: | Size: 239 B |
Before Width: | Height: | Size: 710 B After Width: | Height: | Size: 342 B |
Before Width: | Height: | Size: 828 B After Width: | Height: | Size: 357 B |
Before Width: | Height: | Size: 882 B After Width: | Height: | Size: 410 B |
Before Width: | Height: | Size: 1 KiB After Width: | Height: | Size: 481 B |
Before Width: | Height: | Size: 596 B After Width: | Height: | Size: 230 B |
Before Width: | Height: | Size: 367 B After Width: | Height: | Size: 147 B |
Before Width: | Height: | Size: 682 B After Width: | Height: | Size: 348 B |
Before Width: | Height: | Size: 3.8 KiB After Width: | Height: | Size: 1.9 KiB |
Before Width: | Height: | Size: 288 B After Width: | Height: | Size: 192 B |
Before Width: | Height: | Size: 249 B After Width: | Height: | Size: 186 B |
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
libzint - the open source barcode library
|
||||
Copyright (C) 2020 Robin Stuart <rstuart114@gmail.com>
|
||||
Copyright (C) 2020 - 2021 Robin Stuart <rstuart114@gmail.com>
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions
|
||||
|
@ -164,7 +164,11 @@ static void test_print(int index, int generate, int debug) {
|
|||
/* 29*/ { BARCODE_POSTNET, -1, -1, -1, -1, -1, -1, 0, 3.5, "", "", "12345", "", "../data/png/postnet_zip.png", "300 dpi, using 1/43in X, 300 / 43 / 2 = ~3.5 scale" },
|
||||
/* 30*/ { BARCODE_PDF417, -1, -1, -1, -1, -1, -1, 0, 0, "", "CFCECDCC", "12345", "", "../data/png/pdf417_bgalpha.png", "" },
|
||||
/* 31*/ { BARCODE_PDF417, -1, -1, -1, -1, -1, -1, 0, 0, "30313233", "", "12345", "", "../data/png/pdf417_fgalpha.png", "" },
|
||||
/* 32*/ { BARCODE_ULTRA, -1, -1, 2, -1, -1, -1, 0, 0, "0000007F", "FF000033", "12345", "", "../data/png/ultra_alpha.png", "" },
|
||||
/* 32*/ { BARCODE_PDF417, -1, -1, -1, -1, -1, -1, 0, 0, "20212244", "CFCECDCC", "12345", "", "../data/png/pdf417_bgfgalpha.png", "" },
|
||||
/* 33*/ { BARCODE_ULTRA, -1, -1, 2, -1, -1, -1, 0, 0, "0000007F", "FF000033", "12345", "", "../data/png/ultra_bgfgalpha.png", "" },
|
||||
/* 34*/ { BARCODE_ULTRA, -1, -1, 2, -1, -1, -1, 0, 0, "", "FF000033", "12345", "", "../data/png/ultra_bgalpha.png", "" },
|
||||
/* 35*/ { BARCODE_ULTRA, -1, -1, 2, -1, -1, -1, 0, 0, "0000007F", "FF0000", "12345", "", "../data/png/ultra_fgalpha.png", "" },
|
||||
/* 36*/ { BARCODE_ULTRA, -1, -1, -1, -1, -1, -1, 0, 0, "0000007F", "", "12345", "", "../data/png/ultra_fgalpha_nobg.png", "" },
|
||||
};
|
||||
int data_size = ARRAY_SIZE(data);
|
||||
|
||||
|
@ -242,6 +246,8 @@ static void test_print(int index, int generate, int debug) {
|
|||
|
||||
ret = testUtilCmpPngs(symbol->outfile, data[i].expected_file);
|
||||
assert_zero(ret, "i:%d %s testUtilCmpPngs(%s, %s) %d != 0\n", i, testUtilBarcodeName(data[i].symbology), symbol->outfile, data[i].expected_file, ret);
|
||||
ret = testUtilCmpBins(symbol->outfile, data[i].expected_file);
|
||||
assert_zero(ret, "i:%d %s testUtilCmpBins(%s, %s) %d != 0\n", i, testUtilBarcodeName(data[i].symbology), symbol->outfile, data[i].expected_file, ret);
|
||||
assert_zero(remove(symbol->outfile), "i:%d remove(%s) != 0\n", i, symbol->outfile);
|
||||
}
|
||||
|
||||
|
|
|
@ -166,6 +166,8 @@ static void test_print(int index, int generate, int debug) {
|
|||
} else if (strcmp(exts[j], "png") == 0) {
|
||||
ret = testUtilCmpPngs(symbol->outfile, expected_file);
|
||||
assert_zero(ret, "i:%d %s testUtilCmpPngs(%s, %s) %d != 0\n", i, testUtilBarcodeName(data[i].symbology), symbol->outfile, expected_file, ret);
|
||||
ret = testUtilCmpBins(symbol->outfile, expected_file);
|
||||
assert_zero(ret, "i:%d %s testUtilCmpBins(%s, %s) %d != 0\n", i, testUtilBarcodeName(data[i].symbology), symbol->outfile, expected_file, ret);
|
||||
} else if (strcmp(exts[j], "svg") == 0) {
|
||||
ret = testUtilCmpSvgs(symbol->outfile, expected_file);
|
||||
assert_zero(ret, "i:%d %s testUtilCmpSvgs(%s, %s) %d != 0\n", i, testUtilBarcodeName(data[i].symbology), symbol->outfile, expected_file, ret);
|
||||
|
|