1
0
mirror of https://git.code.sf.net/p/zint/code synced 2026-01-31 07:45:58 +00:00

GS1SE: exclude GS1_128 from requisite AIs check as may be spread

across multiple barcodes (ticket #348, props Harald Oehlmann and Terry Burton)
This commit is contained in:
gitlost
2026-01-30 12:09:13 +00:00
parent 1ba5ba41fb
commit cf5ef9ec20
3 changed files with 80 additions and 59 deletions

View File

@@ -1,7 +1,7 @@
/* gs1.c - Verifies GS1 data */
/*
libzint - the open source barcode library
Copyright (C) 2009-2025 Robin Stuart <rstuart114@gmail.com>
Copyright (C) 2009-2026 Robin Stuart <rstuart114@gmail.com>
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
@@ -1713,6 +1713,15 @@ static int gs1se_verify(struct zint_symbol *symbol, const unsigned char source[]
? ZINT_ERROR_MEMORY : ZINT_ERROR_ENCODING_PROBLEM;
return z_errtxtf(error_number, symbol, 266, "GS1 Syntax Engine: %s", opts.msgBuf);
}
/* Do not check for required checks for GS1-128 as may be spread across multiple barcodes - ticket #348
and https://github.com/gs1/gs1-syntax-dictionary/issues/24 */
if (symbol->symbology == BARCODE_GS1_128) {
if (!gs1_encoder_setValidationEnabled(ctx, gs1_encoder_vREQUISITE_AIS, false)) {
const char *errmsg = gs1_encoder_getErrMsg(ctx);
return z_errtxtf(ZINT_ERROR_ENCODING_PROBLEM, symbol, 0, "Internal error using GS1SE: %.80s",
errmsg ? errmsg : "unknown");
}
}
if (is_digital_link) {
gs1se_ret = gs1_encoder_setDataStr(ctx, ZCCP(local_source2));