mirror of
https://github.com/zint/zint
synced 2024-11-16 20:57:25 +13:00
HANXIN/QRCODE: fix incorrect numeric costings (out-by-1) in
`qr_in_numeric()`/`hx_in_numeric()` (restrict to 3, not 4), ticket #300 (#16), props Andre Maute manual: "Maxicode" -> "MaxiCode"; add max capacities for matrix barcodes
This commit is contained in:
parent
4a340ab614
commit
0a6280dd80
@ -126,11 +126,14 @@ Bugs
|
||||
in `gs1_verify()` on not checking length, ticket #300, props Andre Maute
|
||||
- GS1_128_CC: fix divide-by-zero crash in `calc_padding_ccc()`, ticket #300,
|
||||
props Andre Maute
|
||||
- HANXIN: fix incorrect numeric costings (out-by-1) in `hx_in_numeric()`, ticket
|
||||
#300 (#16), props Andre Maure
|
||||
- PDF417: fix out-of-bounds crash in `pdf_text_submode_length()` and
|
||||
out-of-bounds crash on overrunning string and codeword buffers, ticket #300,
|
||||
props Andre Maute
|
||||
- QRCODE: fix out-of-bounds crash due to incorrect mode costings for GS1
|
||||
percents in `qr_in_alpha()`, ticket #300, props Andre Maute
|
||||
percents in `qr_in_alpha()`; fix incorrect numeric costings (out-by-1) in
|
||||
`qr_in_numeric()`; ticket #300 (#14, #15; #16), props Andre Maute
|
||||
|
||||
|
||||
Version 2.12.0 (2022-12-12)
|
||||
|
@ -308,7 +308,7 @@ static int hx_in_numeric(const unsigned int ddata[], const int length, const int
|
||||
}
|
||||
|
||||
/* Attempt to calculate the average 'cost' of using numeric mode in number of bits (times HX_MULT) */
|
||||
for (i = in_posn; i < length && i < in_posn + 4 && z_isdigit(ddata[i]); i++);
|
||||
for (i = in_posn; i < length && i < in_posn + 3 && z_isdigit(ddata[i]); i++);
|
||||
|
||||
digit_cnt = i - in_posn;
|
||||
|
||||
@ -548,7 +548,7 @@ static void hx_calculate_binary(char binary[], const char mode[], const unsigned
|
||||
bp = bin_append_posn(1, 4, binary, bp);
|
||||
|
||||
if (debug_print) {
|
||||
fputs("Numeric\n", stdout);
|
||||
printf("Numeric (N%d): ", block_length);
|
||||
}
|
||||
|
||||
count = 0; /* Suppress gcc -Wmaybe-uninitialized */
|
||||
@ -574,7 +574,7 @@ static void hx_calculate_binary(char binary[], const char mode[], const unsigned
|
||||
bp = bin_append_posn(encoding_value, 10, binary, bp);
|
||||
|
||||
if (debug_print) {
|
||||
printf("0x%3x (%d)", encoding_value, encoding_value);
|
||||
printf(" 0x%3x(%d)", encoding_value, encoding_value);
|
||||
}
|
||||
|
||||
i += count;
|
||||
@ -604,7 +604,7 @@ static void hx_calculate_binary(char binary[], const char mode[], const unsigned
|
||||
bp = bin_append_posn(2, 4, binary, bp);
|
||||
|
||||
if (debug_print) {
|
||||
fputs("Text\n", stdout);
|
||||
printf("Text (T%d):", block_length);
|
||||
}
|
||||
|
||||
submode = 1;
|
||||
@ -618,7 +618,7 @@ static void hx_calculate_binary(char binary[], const char mode[], const unsigned
|
||||
bp = bin_append_posn(62, 6, binary, bp);
|
||||
submode = hx_getsubmode(ddata[i + position]);
|
||||
if (debug_print) {
|
||||
fputs("SWITCH ", stdout);
|
||||
fputs(" SWITCH", stdout);
|
||||
}
|
||||
}
|
||||
|
||||
@ -631,7 +631,7 @@ static void hx_calculate_binary(char binary[], const char mode[], const unsigned
|
||||
bp = bin_append_posn(encoding_value, 6, binary, bp);
|
||||
|
||||
if (debug_print) {
|
||||
printf("%.2x [ASC %.2x] ", encoding_value, ddata[i + position]);
|
||||
printf(" %.2x[ASC %.2x]", encoding_value, ddata[i + position]);
|
||||
}
|
||||
i++;
|
||||
}
|
||||
@ -652,7 +652,7 @@ static void hx_calculate_binary(char binary[], const char mode[], const unsigned
|
||||
bp = bin_append_posn(block_length + double_byte, 13, binary, bp);
|
||||
|
||||
if (debug_print) {
|
||||
printf("Binary Mode (%d):", block_length + double_byte);
|
||||
printf("Binary Mode (B%d):", block_length + double_byte);
|
||||
}
|
||||
|
||||
i = 0;
|
||||
@ -681,7 +681,8 @@ static void hx_calculate_binary(char binary[], const char mode[], const unsigned
|
||||
}
|
||||
|
||||
if (debug_print) {
|
||||
printf("Region One%s\n", position == 0 || mode[position - 1] != '2' ? "" : " (NO indicator)" );
|
||||
printf("Region One%s H(1)%d:",
|
||||
position == 0 || mode[position - 1] != '2' ? "" : " (NO indicator)", block_length);
|
||||
}
|
||||
|
||||
i = 0;
|
||||
@ -706,7 +707,7 @@ static void hx_calculate_binary(char binary[], const char mode[], const unsigned
|
||||
}
|
||||
|
||||
if (debug_print) {
|
||||
printf("%.3x [GB %.4x] ", glyph, ddata[i + position]);
|
||||
printf(" %.3x[GB %.4x]", glyph, ddata[i + position]);
|
||||
}
|
||||
|
||||
bp = bin_append_posn(glyph, 12, binary, bp);
|
||||
@ -718,7 +719,7 @@ static void hx_calculate_binary(char binary[], const char mode[], const unsigned
|
||||
? 4095 : 4094, 12, binary, bp);
|
||||
|
||||
if (debug_print) {
|
||||
printf("(TERM %x)\n", position + block_length == length || mode[position + block_length] != '2'
|
||||
printf(" (TERM %x)\n", position + block_length == length || mode[position + block_length] != '2'
|
||||
? 4095 : 4094);
|
||||
}
|
||||
|
||||
@ -731,7 +732,8 @@ static void hx_calculate_binary(char binary[], const char mode[], const unsigned
|
||||
}
|
||||
|
||||
if (debug_print) {
|
||||
printf("Region Two%s\n", position == 0 || mode[position - 1] != '1' ? "" : " (NO indicator)" );
|
||||
printf("Region Two%s H(2)%d:",
|
||||
position == 0 || mode[position - 1] != '1' ? "" : " (NO indicator)", block_length);
|
||||
}
|
||||
|
||||
i = 0;
|
||||
@ -743,7 +745,7 @@ static void hx_calculate_binary(char binary[], const char mode[], const unsigned
|
||||
glyph = (0x5e * (first_byte - 0xd8)) + (second_byte - 0xa1);
|
||||
|
||||
if (debug_print) {
|
||||
printf("%.3x [GB %.4x] ", glyph, ddata[i + position]);
|
||||
printf(" %.3x[GB %.4x]", glyph, ddata[i + position]);
|
||||
}
|
||||
|
||||
bp = bin_append_posn(glyph, 12, binary, bp);
|
||||
@ -755,7 +757,7 @@ static void hx_calculate_binary(char binary[], const char mode[], const unsigned
|
||||
? 4095 : 4094, 12, binary, bp);
|
||||
|
||||
if (debug_print) {
|
||||
printf("(TERM %x)\n", position + block_length == length || mode[position + block_length] != '1'
|
||||
printf(" (TERM %x)\n", position + block_length == length || mode[position + block_length] != '1'
|
||||
? 4095 : 4094);
|
||||
}
|
||||
|
||||
@ -766,7 +768,7 @@ static void hx_calculate_binary(char binary[], const char mode[], const unsigned
|
||||
bp = bin_append_posn(6, 4, binary, bp);
|
||||
|
||||
if (debug_print) {
|
||||
fputs("Double byte\n", stdout);
|
||||
printf("Double byte (H(d)%d):", block_length);
|
||||
}
|
||||
|
||||
i = 0;
|
||||
@ -801,7 +803,7 @@ static void hx_calculate_binary(char binary[], const char mode[], const unsigned
|
||||
case 'f':
|
||||
/* Four-byte encoding */
|
||||
if (debug_print) {
|
||||
fputs("Four byte\n", stdout);
|
||||
printf("Four byte (H(f)%d):", block_length);
|
||||
}
|
||||
|
||||
i = 0;
|
||||
@ -820,7 +822,7 @@ static void hx_calculate_binary(char binary[], const char mode[], const unsigned
|
||||
(0x0a * (third_byte - 0x81)) + (fourth_byte - 0x30);
|
||||
|
||||
if (debug_print) {
|
||||
printf("%d ", glyph);
|
||||
printf(" %d", glyph);
|
||||
}
|
||||
|
||||
bp = bin_append_posn(glyph, 21, binary, bp);
|
||||
@ -1554,7 +1556,7 @@ INTERNAL int hanxin(struct zint_symbol *symbol, struct zint_seg segs[], const in
|
||||
codewords++;
|
||||
}
|
||||
if (debug_print) {
|
||||
printf("Num. of codewords: %d\n", codewords);
|
||||
printf("Num. of codewords: %d (%d padbits)\n", codewords, bin_len & 0x07);
|
||||
}
|
||||
|
||||
version = 85;
|
||||
|
12
backend/qr.c
12
backend/qr.c
@ -77,7 +77,7 @@ static int qr_in_numeric(const unsigned int ddata[], const int length, const int
|
||||
}
|
||||
|
||||
/* Attempt to calculate the average 'cost' of using numeric mode in number of bits (times QR_MULT) */
|
||||
for (i = in_posn; i < length && i < in_posn + 4 && z_isdigit(ddata[i]); i++);
|
||||
for (i = in_posn; i < length && i < in_posn + 3 && z_isdigit(ddata[i]); i++);
|
||||
|
||||
digit_cnt = i - in_posn;
|
||||
|
||||
@ -302,11 +302,15 @@ static void qr_define_mode(char mode[], const unsigned int ddata[], const int le
|
||||
}
|
||||
|
||||
#ifdef QR_DEBUG_DEFINE_MODE
|
||||
{
|
||||
int min_j = 0;
|
||||
printf(" % 4d: curr", i);
|
||||
for (j = 0; j < QR_NUM_MODES; j++) {
|
||||
printf(" %c(%c)=%d", qr_mode_types[j], char_modes[cm_i + j], cur_costs[j]);
|
||||
if (cur_costs[j] < cur_costs[min_j]) min_j = j;
|
||||
}
|
||||
printf(" min %c(%c)=%d\n", qr_mode_types[min_j], char_modes[cm_i + min_j], cur_costs[min_j]);
|
||||
}
|
||||
printf("\n");
|
||||
#endif
|
||||
memcpy(prev_costs, cur_costs, QR_NUM_MODES * sizeof(unsigned int));
|
||||
}
|
||||
@ -762,7 +766,7 @@ static int qr_binary_segs(unsigned char datastream[], const int version, const i
|
||||
}
|
||||
|
||||
if (debug_print) {
|
||||
fputs("Resulting codewords:\n\t", stdout);
|
||||
printf("Resulting codewords (%d):\n\t", target_codewords);
|
||||
for (i = 0; i < target_codewords; i++) {
|
||||
printf("0x%02X ", datastream[i]);
|
||||
}
|
||||
@ -867,7 +871,7 @@ static void qr_add_ecc(unsigned char fullstream[], const unsigned char datastrea
|
||||
}
|
||||
|
||||
if (debug_print) {
|
||||
fputs("\nData Stream: \n", stdout);
|
||||
printf("\nData Stream (%d): \n", data_cw + ecc_cw);
|
||||
for (j = 0; j < (data_cw + ecc_cw); j++) {
|
||||
printf("%2X ", fullstream[j]);
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -8884,6 +8884,7 @@ static void test_fuzz(const testCtx *const p_ctx) {
|
||||
struct item {
|
||||
int symbology;
|
||||
int input_mode;
|
||||
int eci;
|
||||
int option_1;
|
||||
int option_2;
|
||||
int option_3;
|
||||
@ -8895,8 +8896,9 @@ static void test_fuzz(const testCtx *const p_ctx) {
|
||||
};
|
||||
/* s/\/\*[ 0-9]*\*\//\=printf("\/\*%3d*\/", line(".") - line("'<")): */
|
||||
struct item data[] = {
|
||||
/* 0*/ { BARCODE_QRCODE, GS1_MODE | GS1NOCHECK_MODE, -1, -1, -1, "[]CCCCCLLLLLLLLLLLLLLLLLLLLLCCCCCCCC@CCCCCCCCCCCCCCCCCCCCCCC%%C%C%%%%%%%%%%%%%%LLLCCCCCCCC%%C%C%%%%%%%%%%%%%%LLLLLLLLLLLLLLLLLLL000000032861710*383556LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL155816162LLLLLCC%%C%C%%%%%%%%%%%%%%LLLCCCCCCCC%%C%C%%%%%%%%%%%%%%LLLLLLLLLL)!1661055777[723]T5", -1, 0, 1, "" }, /* #300 (#14), Andre Maute */
|
||||
/* 1*/ { BARCODE_QRCODE, DATA_MODE, -1, -1, ZINT_FULL_MULTIBYTE, "\215\215\350\2156750\215\215\215\215\215\215\000\000\000\025\215\215\215\215\215\232\215\232\232\001\361\215\215\215\215\215\221\215\215\215\215JJJJJJNJJJJJJ\215\215\215\2159999\215\215\215\215\215\215\215\215\215\235\215\215\215\215\215\035\004\000\000@\000\000\000\000\375\000\000\000\000\000\000\000\000\000\000\000\000\000\241\000\000\000\000\000\000\000\241\247^^^\377\377\377\000 \000\000\000\000\000\000\377\377u\000\000\000\000\000\000\000^\377\377^^\000:\000\177\377\377\377?\377\377\377\377\377\377\377\377\377\377\377\377\377\377\241\241\232\232\232\232\232\232\232\232\000\377\377\377\242\003\000\000\377\377/\000AA\000\000\000\000\000\000\000\000\000\000\000\000T\000\000\000\000\000\000\000\000WWW\237\250WWWWWW\377\377R30 \377\377\000\000\000", 231, 0, 1, "" }, /* #300 (#15), Andre Maute */
|
||||
/* 0*/ { BARCODE_QRCODE, GS1_MODE | GS1NOCHECK_MODE, -1, -1, -1, -1, "[]CCCCCLLLLLLLLLLLLLLLLLLLLLCCCCCCCC@CCCCCCCCCCCCCCCCCCCCCCC%%C%C%%%%%%%%%%%%%%LLLCCCCCCCC%%C%C%%%%%%%%%%%%%%LLLLLLLLLLLLLLLLLLL000000032861710*383556LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL155816162LLLLLCC%%C%C%%%%%%%%%%%%%%LLLCCCCCCCC%%C%C%%%%%%%%%%%%%%LLLLLLLLLL)!1661055777[723]T5", -1, 0, 1, "" }, /* #300 (#14), Andre Maute */
|
||||
/* 1*/ { BARCODE_QRCODE, DATA_MODE, -1, -1, -1, ZINT_FULL_MULTIBYTE, "\215\215\350\2156750\215\215\215\215\215\215\000\000\000\025\215\215\215\215\215\232\215\232\232\001\361\215\215\215\215\215\221\215\215\215\215JJJJJJNJJJJJJ\215\215\215\2159999\215\215\215\215\215\215\215\215\215\235\215\215\215\215\215\035\004\000\000@\000\000\000\000\375\000\000\000\000\000\000\000\000\000\000\000\000\000\241\000\000\000\000\000\000\000\241\247^^^\377\377\377\000 \000\000\000\000\000\000\377\377u\000\000\000\000\000\000\000^\377\377^^\000:\000\177\377\377\377?\377\377\377\377\377\377\377\377\377\377\377\377\377\377\241\241\232\232\232\232\232\232\232\232\000\377\377\377\242\003\000\000\377\377/\000AA\000\000\000\000\000\000\000\000\000\000\000\000T\000\000\000\000\000\000\000\000WWW\237\250WWWWWW\377\377R30 \377\377\000\000\000", 231, 0, 1, "" }, /* #300 (#15), Andre Maute */
|
||||
/* 2*/ { BARCODE_QRCODE, DATA_MODE, 35, -1, -1, ZINT_FULL_MULTIBYTE, "\215\215\215\215\215\350\215\215999\215\21500000\215\215\215\215\215\215\377O\000\000\036\000\000\000\000\357\376\026\377\377\377\377\241\241\232\232\232\232\232\232\235\032@\374:JGB \000\000@d\000\000\000\241\241\000\000\027\002\241\241\000\000\014\000\000\000\000\357\327\004\000\000\000\000\000\000\000\375\000\000\000\000\000\000\000\000\000\000\000\000\0000253]9R4R44,44,4404[255\350999\215\21599999\215\215\215\2150000\215\215\215\215\215\215\215\215\215]9444442<4444,4044%44vA\000\000\002\000'\000\000\215\377@\215\215\350\215\215\215\215\215\215\215\307\306\306n\215\215\000\000\001\000\000\203\000\000\000\000\000\000@\215\215\215[\2154315@]R0", 229, 0, 1, "" }, /* #300 (#16), Andre Maute */
|
||||
};
|
||||
int data_size = ARRAY_SIZE(data);
|
||||
int i, length, ret;
|
||||
@ -8911,7 +8913,7 @@ static void test_fuzz(const testCtx *const p_ctx) {
|
||||
symbol = ZBarcode_Create();
|
||||
assert_nonnull(symbol, "Symbol not created\n");
|
||||
|
||||
length = testUtilSetSymbol(symbol, data[i].symbology, data[i].input_mode, -1 /*eci*/, data[i].option_1, data[i].option_2, data[i].option_3, -1 /*output_options*/, data[i].data, data[i].length, debug);
|
||||
length = testUtilSetSymbol(symbol, data[i].symbology, data[i].input_mode, data[i].eci, data[i].option_1, data[i].option_2, data[i].option_3, -1 /*output_options*/, data[i].data, data[i].length, debug);
|
||||
|
||||
ret = ZBarcode_Encode(symbol, (unsigned char *) data[i].data, length);
|
||||
assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt);
|
||||
|
@ -32,9 +32,7 @@ run_zxingcpp_test "test_dmatrix" "encode_segs"
|
||||
run_zxingcpp_test "test_dotcode" "input"
|
||||
run_zxingcpp_test "test_dotcode" "encode"
|
||||
run_zxingcpp_test "test_dotcode" "encode_segs"
|
||||
run_zxingcpp_test "test_hanxin" "input"
|
||||
run_zxingcpp_test "test_hanxin" "encode"
|
||||
run_zxingcpp_test "test_hanxin" "encode_segs"
|
||||
run_zxingcpp_test "test_hanxin"
|
||||
run_zxingcpp_test "test_mailmark" "2d_encode"
|
||||
run_zxingcpp_test "test_maxicode" "input"
|
||||
run_zxingcpp_test "test_maxicode" "encode"
|
||||
|
@ -2238,22 +2238,22 @@ option, which sets the X-dimension. The default scale is 1.</p>
|
||||
being applied to the X-dimension. For MaxiCode, it is multiplied by 10
|
||||
for raster output, by 40 for EMF vector output, and by 2 otherwise
|
||||
(non-EMF vector output).</p>
|
||||
<p>For non-Maxicode raster output, the default scale of 1 results in an
|
||||
X-dimension of 2 pixels. For example for non-Maxicode PNG images a scale
|
||||
of 5 will increase the X-dimension to 10 pixels. For Maxicode, see <a
|
||||
<p>For non-MaxiCode raster output, the default scale of 1 results in an
|
||||
X-dimension of 2 pixels. For example for non-MaxiCode PNG images a scale
|
||||
of 5 will increase the X-dimension to 10 pixels. For MaxiCode, see <a
|
||||
href="#maxicode-raster-scaling">4.9.3 MaxiCode Raster Scaling</a>
|
||||
below.</p>
|
||||
<p>Scales for non-Maxicode raster output should be given in increments
|
||||
<p>Scales for non-MaxiCode raster output should be given in increments
|
||||
of 0.5, i.e. 0.5, 1, 1.5, 2, 2.5, 3, 3.5, etc., to avoid the X-dimension
|
||||
varying across the symbol due to interpolation. 0.5 increments are also
|
||||
faster to render.</p>
|
||||
<p>The minimum scale for non-Maxicode raster output in non-dotty mode is
|
||||
<p>The minimum scale for non-MaxiCode raster output in non-dotty mode is
|
||||
0.5, giving a minimum X-dimension of 1 pixel. For MaxiCode, it is 0.2.
|
||||
The minimum scale for raster output in dotty mode is 1 (see <a
|
||||
href="#working-with-dots">4.15 Working with Dots</a>). For raster
|
||||
output, text will not be printed for scales less than 1.</p>
|
||||
<p>The minimum scale for vector output is 0.1, giving a minimum
|
||||
X-dimension of 0.2 (or for Maxicode EMF output, 4). The maximum scale
|
||||
X-dimension of 0.2 (or for MaxiCode EMF output, 4). The maximum scale
|
||||
for both raster and vector is 200.</p>
|
||||
<p>To summarize the more intricate details:</p>
|
||||
<div id="tbl:scaling_multiplers" class="tablenos">
|
||||
@ -5908,6 +5908,8 @@ from Zint.</p>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<p>The largest version 24 (144 x 144) can encode 3116 digits, around
|
||||
2335 alphanumeric characters, or 1555 bytes of data.</p>
|
||||
<p>When using automatic symbol sizes you can force Zint to use square
|
||||
symbols (versions 1-24) at the command line by using the option
|
||||
<code>--square</code> (API <code>option_3 = DM_SQUARE</code>).</p>
|
||||
@ -6482,6 +6484,8 @@ characters <code>"$%*+-./:"</code></td>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<p>Version M4 can encode up to 35 digits, 21 alphanumerics, 15 bytes or
|
||||
9 Kanji characters.</p>
|
||||
<p>Except for version M1, which is always ECC level L, the amount of ECC
|
||||
codewords can be adjusted using the <code>--secure</code> option (API
|
||||
<code>option_1</code>); however ECC level H is not available for any
|
||||
@ -6788,6 +6792,8 @@ while allowing Zint to determine the minimum symbol width.</p>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<p>The largest version R17x139 (32) can encode up to 361 digits, 219
|
||||
alphanumerics, 150 bytes, or 92 Kanji characters.</p>
|
||||
<p>For barcode readers that support it, non-ASCII data density may be
|
||||
maximized by using the <code>--fullmultibyte</code> switch or in the API
|
||||
by setting <code>option_3 = ZINT_FULL_MULTIBYTE</code>.</p>
|
||||
@ -7330,7 +7336,8 @@ aria-hidden="true"><code>zint -b GRIDMATRIX --eci=29 -d "AAT2556 电池充电器
|
||||
supports the GB 2312 standard set, which includes Hanzi, ASCII and a
|
||||
small number of ISO/IEC 8859-1 characters. Input should be entered as
|
||||
UTF-8 with conversion to GB 2312 being carried out automatically by
|
||||
Zint. The symbology also supports the ECI mechanism. Support for GS1
|
||||
Zint. Up to around 1529 alphanumeric characters or 2751 digits may be
|
||||
encoded. The symbology also supports the ECI mechanism. Support for GS1
|
||||
data has not yet been implemented.</p>
|
||||
<p>The size of the symbol and the error correction capacity can be
|
||||
specified. If you specify both of these values then Zint will make a
|
||||
@ -7790,6 +7797,9 @@ to the following table.</p>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<p>The largest version (84) can encode 7827 digits, 4350 ASCII
|
||||
characters, up to 2175 Chinese characters, or 3261 bytes, making it the
|
||||
most capacious of all the barcodes supported by Zint.</p>
|
||||
<p>There are four levels of error correction capacity available for Han
|
||||
Xin Code which can be set by using the <code>--secure</code> option (API
|
||||
<code>option_1</code>) to a value from the following table.</p>
|
||||
@ -7895,11 +7905,16 @@ data-tag=": Ultracode Error Correction Values">
|
||||
this can be initiated through the API by setting</p>
|
||||
<div class="sourceCode" id="cb117"><pre
|
||||
class="sourceCode c"><code class="sourceCode c"><span id="cb117-1"><a href="#cb117-1" aria-hidden="true" tabindex="-1"></a>symbol<span class="op">-></span>option_3 <span class="op">=</span> ULTRA_COMPRESSION<span class="op">;</span></span></code></pre></div>
|
||||
<p>WARNING: Ultracode data compression is experimental and should not be
|
||||
used in a production environment.</p>
|
||||
<p>Revision 2 of Ultracode (2021) which swops and inverts the DCCU and
|
||||
<p>With compression, up to 504 digits, 375 alphanumerics or 252 bytes
|
||||
can be encoded.</p>
|
||||
<p>Revision 2 of Ultracode (2023) which swops and inverts the DCCU and
|
||||
DCCL tiles may be specified using <code>--vers=2</code> (API
|
||||
<code>option_2 = 2</code>).</p>
|
||||
<hr />
|
||||
<p>WARNING: Revision 2 of Ultracode is currently (December 2023)
|
||||
undergoing major modifications, yet to be finalized, and should not be
|
||||
used in a production environment.</p>
|
||||
<hr />
|
||||
<p>Ultracode supports Structured Append of up to 8 symbols and an
|
||||
optional numeric ID (File Number), which can be set by using the
|
||||
<code>--structapp</code> option (see <a href="#structured-append">4.17
|
||||
|
@ -1077,22 +1077,22 @@ The scale is multiplied by 2 (with the exception of MaxiCode) before being
|
||||
applied to the X-dimension. For MaxiCode, it is multiplied by 10 for raster
|
||||
output, by 40 for EMF vector output, and by 2 otherwise (non-EMF vector output).
|
||||
|
||||
For non-Maxicode raster output, the default scale of 1 results in an X-dimension
|
||||
of 2 pixels. For example for non-Maxicode PNG images a scale of 5 will increase
|
||||
the X-dimension to 10 pixels. For Maxicode, see [4.9.3 MaxiCode Raster Scaling]
|
||||
For non-MaxiCode raster output, the default scale of 1 results in an X-dimension
|
||||
of 2 pixels. For example for non-MaxiCode PNG images a scale of 5 will increase
|
||||
the X-dimension to 10 pixels. For MaxiCode, see [4.9.3 MaxiCode Raster Scaling]
|
||||
below.
|
||||
|
||||
Scales for non-Maxicode raster output should be given in increments of 0.5, i.e.
|
||||
Scales for non-MaxiCode raster output should be given in increments of 0.5, i.e.
|
||||
0.5, 1, 1.5, 2, 2.5, 3, 3.5, etc., to avoid the X-dimension varying across the
|
||||
symbol due to interpolation. 0.5 increments are also faster to render.
|
||||
|
||||
The minimum scale for non-Maxicode raster output in non-dotty mode is 0.5,
|
||||
The minimum scale for non-MaxiCode raster output in non-dotty mode is 0.5,
|
||||
giving a minimum X-dimension of 1 pixel. For MaxiCode, it is 0.2. The minimum
|
||||
scale for raster output in dotty mode is 1 (see [4.15 Working with Dots]). For
|
||||
raster output, text will not be printed for scales less than 1.
|
||||
|
||||
The minimum scale for vector output is 0.1, giving a minimum X-dimension of 0.2
|
||||
(or for Maxicode EMF output, 4). The maximum scale for both raster and vector is
|
||||
(or for MaxiCode EMF output, 4). The maximum scale for both raster and vector is
|
||||
200.
|
||||
|
||||
To summarize the more intricate details:
|
||||
@ -3869,6 +3869,9 @@ Input Symbol Size Input Symbol Size Input Symbol Size
|
||||
|
||||
Table: {#tbl:datamatrix_sizes tag=": Data Matrix Sizes"}
|
||||
|
||||
The largest version 24 (144 x 144) can encode 3116 digits, around 2335
|
||||
alphanumeric characters, or 1555 bytes of data.
|
||||
|
||||
When using automatic symbol sizes you can force Zint to use square symbols
|
||||
(versions 1-24) at the command line by using the option `--square` (API
|
||||
`option_3 = DM_SQUARE`).
|
||||
@ -4076,6 +4079,9 @@ Input Version Symbol Size Allowed Characters
|
||||
|
||||
Table: {#tbl:micrqr_sizes tag=": Micro QR Code Sizes"}
|
||||
|
||||
Version M4 can encode up to 35 digits, 21 alphanumerics, 15 bytes or 9 Kanji
|
||||
characters.
|
||||
|
||||
Except for version M1, which is always ECC level L, the amount of ECC codewords
|
||||
can be adjusted using the `--secure` option (API `option_1`); however ECC level
|
||||
H is not available for any version, and ECC level Q is only available for
|
||||
@ -4174,6 +4180,9 @@ Input Version Symbol Size (HxW) Input Version Symbol Size (HxW)
|
||||
|
||||
Table: {#tbl:rmqr_sizes tag=": rMQR Sizes"}
|
||||
|
||||
The largest version R17x139 (32) can encode up to 361 digits, 219 alphanumerics,
|
||||
150 bytes, or 92 Kanji characters.
|
||||
|
||||
For barcode readers that support it, non-ASCII data density may be maximized by
|
||||
using the `--fullmultibyte` switch or in the API by setting
|
||||
`option_3 = ZINT_FULL_MULTIBYTE`.
|
||||
@ -4423,8 +4432,9 @@ GS1 data nor for Version S symbols.
|
||||
Grid Matrix groups modules in a chequerboard pattern, and by default supports
|
||||
the GB 2312 standard set, which includes Hanzi, ASCII and a small number of
|
||||
ISO/IEC 8859-1 characters. Input should be entered as UTF-8 with conversion to
|
||||
GB 2312 being carried out automatically by Zint. The symbology also supports the
|
||||
ECI mechanism. Support for GS1 data has not yet been implemented.
|
||||
GB 2312 being carried out automatically by Zint. Up to around 1529 alphanumeric
|
||||
characters or 2751 digits may be encoded. The symbology also supports the ECI
|
||||
mechanism. Support for GS1 data has not yet been implemented.
|
||||
|
||||
The size of the symbol and the error correction capacity can be specified. If
|
||||
you specify both of these values then Zint will make a 'best-fit' attempt to
|
||||
@ -4533,6 +4543,10 @@ Input Symbol Size Input Symbol Size Input Symbol Size
|
||||
|
||||
Table: {#tbl:hanxin_sizes tag=": Han Xin Sizes"}
|
||||
|
||||
The largest version (84) can encode 7827 digits, 4350 ASCII characters, up to
|
||||
2175 Chinese characters, or 3261 bytes, making it the most capacious of all the
|
||||
barcodes supported by Zint.
|
||||
|
||||
There are four levels of error correction capacity available for Han Xin Code
|
||||
which can be set by using the `--secure` option (API `option_1`) to a value from
|
||||
the following table.
|
||||
@ -4585,12 +4599,19 @@ initiated through the API by setting
|
||||
symbol->option_3 = ULTRA_COMPRESSION;
|
||||
```
|
||||
|
||||
WARNING: Ultracode data compression is experimental and should not be used in a
|
||||
production environment.
|
||||
With compression, up to 504 digits, 375 alphanumerics or 252 bytes can be
|
||||
encoded.
|
||||
|
||||
Revision 2 of Ultracode (2021) which swops and inverts the DCCU and DCCL tiles
|
||||
Revision 2 of Ultracode (2023) which swops and inverts the DCCU and DCCL tiles
|
||||
may be specified using `--vers=2` (API `option_2 = 2`).
|
||||
|
||||
* * *
|
||||
WARNING: Revision 2 of Ultracode is currently (December 2023) undergoing major
|
||||
modifications, yet to be finalized, and should not be used in a production
|
||||
environment.
|
||||
|
||||
* * *
|
||||
|
||||
Ultracode supports Structured Append of up to 8 symbols and an optional numeric
|
||||
ID (File Number), which can be set by using the `--structapp` option (see [4.17
|
||||
Structured Append]) (API `structapp`). The ID ranges from 1 to 80088. If an ID
|
||||
|
@ -1169,22 +1169,22 @@ The scale is multiplied by 2 (with the exception of MaxiCode) before being
|
||||
applied to the X-dimension. For MaxiCode, it is multiplied by 10 for raster
|
||||
output, by 40 for EMF vector output, and by 2 otherwise (non-EMF vector output).
|
||||
|
||||
For non-Maxicode raster output, the default scale of 1 results in an X-dimension
|
||||
of 2 pixels. For example for non-Maxicode PNG images a scale of 5 will increase
|
||||
the X-dimension to 10 pixels. For Maxicode, see 4.9.3 MaxiCode Raster Scaling
|
||||
For non-MaxiCode raster output, the default scale of 1 results in an X-dimension
|
||||
of 2 pixels. For example for non-MaxiCode PNG images a scale of 5 will increase
|
||||
the X-dimension to 10 pixels. For MaxiCode, see 4.9.3 MaxiCode Raster Scaling
|
||||
below.
|
||||
|
||||
Scales for non-Maxicode raster output should be given in increments of 0.5, i.e.
|
||||
Scales for non-MaxiCode raster output should be given in increments of 0.5, i.e.
|
||||
0.5, 1, 1.5, 2, 2.5, 3, 3.5, etc., to avoid the X-dimension varying across the
|
||||
symbol due to interpolation. 0.5 increments are also faster to render.
|
||||
|
||||
The minimum scale for non-Maxicode raster output in non-dotty mode is 0.5,
|
||||
The minimum scale for non-MaxiCode raster output in non-dotty mode is 0.5,
|
||||
giving a minimum X-dimension of 1 pixel. For MaxiCode, it is 0.2. The minimum
|
||||
scale for raster output in dotty mode is 1 (see 4.15 Working with Dots). For
|
||||
raster output, text will not be printed for scales less than 1.
|
||||
|
||||
The minimum scale for vector output is 0.1, giving a minimum X-dimension of 0.2
|
||||
(or for Maxicode EMF output, 4). The maximum scale for both raster and vector is
|
||||
(or for MaxiCode EMF output, 4). The maximum scale for both raster and vector is
|
||||
200.
|
||||
|
||||
To summarize the more intricate details:
|
||||
@ -3715,6 +3715,9 @@ standards have now been removed from Zint.
|
||||
|
||||
: Table : Data Matrix Sizes:
|
||||
|
||||
The largest version 24 (144 x 144) can encode 3116 digits, around 2335
|
||||
alphanumeric characters, or 1555 bytes of data.
|
||||
|
||||
When using automatic symbol sizes you can force Zint to use square symbols
|
||||
(versions 1-24) at the command line by using the option --square (API
|
||||
option_3 = DM_SQUARE).
|
||||
@ -3918,6 +3921,9 @@ that versions M1 and M2 have restrictions on what characters can be encoded.
|
||||
|
||||
: Table : Micro QR Code Sizes:
|
||||
|
||||
Version M4 can encode up to 35 digits, 21 alphanumerics, 15 bytes or 9 Kanji
|
||||
characters.
|
||||
|
||||
Except for version M1, which is always ECC level L, the amount of ECC codewords
|
||||
can be adjusted using the --secure option (API option_1); however ECC level H is
|
||||
not available for any version, and ECC level Q is only available for version M4:
|
||||
@ -4014,6 +4020,9 @@ height of the symbol while allowing Zint to determine the minimum symbol width.
|
||||
|
||||
: Table : rMQR Sizes:
|
||||
|
||||
The largest version R17x139 (32) can encode up to 361 digits, 219 alphanumerics,
|
||||
150 bytes, or 92 Kanji characters.
|
||||
|
||||
For barcode readers that support it, non-ASCII data density may be maximized by
|
||||
using the --fullmultibyte switch or in the API by setting
|
||||
option_3 = ZINT_FULL_MULTIBYTE.
|
||||
@ -4253,8 +4262,9 @@ data nor for Version S symbols.
|
||||
Grid Matrix groups modules in a chequerboard pattern, and by default supports
|
||||
the GB 2312 standard set, which includes Hanzi, ASCII and a small number of
|
||||
ISO/IEC 8859-1 characters. Input should be entered as UTF-8 with conversion to
|
||||
GB 2312 being carried out automatically by Zint. The symbology also supports the
|
||||
ECI mechanism. Support for GS1 data has not yet been implemented.
|
||||
GB 2312 being carried out automatically by Zint. Up to around 1529 alphanumeric
|
||||
characters or 2751 digits may be encoded. The symbology also supports the ECI
|
||||
mechanism. Support for GS1 data has not yet been implemented.
|
||||
|
||||
The size of the symbol and the error correction capacity can be specified. If
|
||||
you specify both of these values then Zint will make a ‘best-fit’ attempt to
|
||||
@ -4362,6 +4372,10 @@ to a value between 1 and 84 according to the following table.
|
||||
|
||||
: Table : Han Xin Sizes:
|
||||
|
||||
The largest version (84) can encode 7827 digits, 4350 ASCII characters, up to
|
||||
2175 Chinese characters, or 3261 bytes, making it the most capacious of all the
|
||||
barcodes supported by Zint.
|
||||
|
||||
There are four levels of error correction capacity available for Han Xin Code
|
||||
which can be set by using the --secure option (API option_1) to a value from the
|
||||
following table.
|
||||
@ -4410,12 +4424,20 @@ initiated through the API by setting
|
||||
|
||||
symbol->option_3 = ULTRA_COMPRESSION;
|
||||
|
||||
WARNING: Ultracode data compression is experimental and should not be used in a
|
||||
production environment.
|
||||
With compression, up to 504 digits, 375 alphanumerics or 252 bytes can be
|
||||
encoded.
|
||||
|
||||
Revision 2 of Ultracode (2021) which swops and inverts the DCCU and DCCL tiles
|
||||
Revision 2 of Ultracode (2023) which swops and inverts the DCCU and DCCL tiles
|
||||
may be specified using --vers=2 (API option_2 = 2).
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
WARNING: Revision 2 of Ultracode is currently (December 2023) undergoing major
|
||||
modifications, yet to be finalized, and should not be used in a production
|
||||
environment.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
Ultracode supports Structured Append of up to 8 symbols and an optional numeric
|
||||
ID (File Number), which can be set by using the --structapp option (see 4.17
|
||||
Structured Append) (API structapp). The ID ranges from 1 to 80088. If an ID is
|
||||
|
Loading…
Reference in New Issue
Block a user