dxfilmedge: make raw_segs consistent with zxing-cpp

Details see here:
https://github.com/zxing-cpp/zxing-cpp/issues/883#issuecomment-2776593838
This commit is contained in:
Axel Waggershauser 2025-04-04 23:36:33 +02:00 committed by gitlost
parent 789e049945
commit b423e260b9
2 changed files with 8 additions and 8 deletions

View file

@ -246,7 +246,7 @@ static int dx_parse_code(struct zint_symbol *symbol, const unsigned char *source
*output_length = bp;
if (raw_text && rt_printf_256(symbol, "%04d%s", (dx_code_1 << 4) | dx_code_2, frame_info)) {
if (raw_text && rt_printf_256(symbol, (*has_frame_info ? "%d-%d%s%s" : "%d-%d"), dx_code_1, dx_code_2, "/", frame_info)) {
return ZINT_ERROR_MEMORY; /* `rt_printf_256()` only fails with OOM */
}

View file

@ -44,19 +44,19 @@ static void test_hrt(const testCtx *const p_ctx) {
/* s/\/\*[ 0-9]*\*\//\=printf("\/\*%3d*\/", line(".") - line("'<")): */
static const struct item data[] = {
/* 0*/ { -1, "79-7", "", "" }, /* None */
/* 1*/ { BARCODE_RAW_TEXT, "79-7", "", "1271" },
/* 1*/ { BARCODE_RAW_TEXT, "79-7", "", "79-7" },
/* 2*/ { -1, "1271", "", "" }, /* None */
/* 3*/ { BARCODE_RAW_TEXT, "1271", "", "1271" },
/* 3*/ { BARCODE_RAW_TEXT, "1271", "", "79-7" },
/* 4*/ { -1, "012710", "", "" }, /* None */
/* 5*/ { BARCODE_RAW_TEXT, "012710", "", "1271" },
/* 5*/ { BARCODE_RAW_TEXT, "012710", "", "79-7" },
/* 6*/ { -1, "1-0", "", "" }, /* None */
/* 7*/ { BARCODE_RAW_TEXT, "1-0", "", "0016" },
/* 7*/ { BARCODE_RAW_TEXT, "1-0", "", "1-0" },
/* 8*/ { -1, "2047/63A", "", "" }, /* None */
/* 9*/ { BARCODE_RAW_TEXT, "2047/63A", "", "204763A" },
/* 9*/ { BARCODE_RAW_TEXT, "2047/63A", "", "127-15/63A" },
/* 10*/ { -1, "79-7/1", "", "" }, /* None */
/* 11*/ { BARCODE_RAW_TEXT, "79-7/1", "", "12711" },
/* 11*/ { BARCODE_RAW_TEXT, "79-7/1", "", "79-7/1" },
/* 12*/ { -1, "79-7/sa", "", "" }, /* None */
/* 13*/ { BARCODE_RAW_TEXT, "79-7/sa", "", "127162A" },
/* 13*/ { BARCODE_RAW_TEXT, "79-7/sa", "", "79-7/62A" },
};
const int data_size = ARRAY_SIZE(data);
int i, length, ret;