mirror of
https://git.code.sf.net/p/zint/code
synced 2025-05-18 17:25:09 -04:00
Converted zint_symbol structure usage to a more compressed format
This commit is contained in:
parent
90d301a6dc
commit
cb0e4e27e8
29 changed files with 447 additions and 341 deletions
10
backend/qr.c
10
backend/qr.c
|
@ -71,7 +71,7 @@ int qr_code(struct zint_symbol *symbol, unsigned char source[])
|
|||
|
||||
code = encode(symbol->option_1, symbol->option_2, source, kanji);
|
||||
if(code == NULL) {
|
||||
strcpy(symbol->errtxt, "libqrencode failed to encode the input data [581]");
|
||||
strcpy(symbol->errtxt, "libqrencode failed to encode the input data");
|
||||
return ERROR_ENCODING_PROBLEM;
|
||||
}
|
||||
|
||||
|
@ -80,10 +80,8 @@ int qr_code(struct zint_symbol *symbol, unsigned char source[])
|
|||
|
||||
for(i = 0; i < code->width; i++) {
|
||||
for(j = 0; j < code->width; j++) {
|
||||
if((*(code->data + (i * code->width) + j) & 0x01) == 0) {
|
||||
symbol->encoded_data[i][j] = '0';
|
||||
} else {
|
||||
symbol->encoded_data[i][j] = '1';
|
||||
if((*(code->data + (i * code->width) + j) & 0x01) != 0) {
|
||||
set_module(symbol, i, j);
|
||||
}
|
||||
}
|
||||
symbol->row_height[i] = 1;
|
||||
|
@ -98,7 +96,7 @@ int qr_code(struct zint_symbol *symbol, unsigned char source[])
|
|||
/* Handler if no QR Encode library is available */
|
||||
int qr_code(struct zint_symbol *symbol, unsigned char source[])
|
||||
{
|
||||
strcpy(symbol->errtxt, "QR Code library <qrencode> not available [580]");
|
||||
strcpy(symbol->errtxt, "QR Code library <qrencode> not available");
|
||||
return ERROR_INVALID_OPTION;
|
||||
}
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue