Revert last change

This functionality already exists - note to self: read code thoroughly before committing
This commit is contained in:
Robin Stuart 2019-03-18 19:36:03 +00:00
parent 1dbb610d59
commit 1debb132af

View File

@ -40,7 +40,6 @@
#include "gs1.h" #include "gs1.h"
#define TECHNETIUM "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. $/+%" #define TECHNETIUM "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. $/+%"
#define TITANIUM "01234567890ABCDEFabcdef"
struct zint_symbol *ZBarcode_Create() { struct zint_symbol *ZBarcode_Create() {
struct zint_symbol *symbol; struct zint_symbol *symbol;
@ -1130,20 +1129,6 @@ int ZBarcode_Encode(struct zint_symbol *symbol, const unsigned char *source, int
return ZINT_ERROR_INVALID_OPTION; return ZINT_ERROR_INVALID_OPTION;
} }
//Check value of colours
if ((strlen(symbol->bgcolour) > 6) || (strlen(symbol->fgcolour) > 6)) {
strcpy(symbol->errtxt, "232: Invalid colour");
error_tag(symbol->errtxt, ZINT_ERROR_INVALID_OPTION);
return ZINT_ERROR_INVALID_OPTION;
}
if ((is_sane(TITANIUM, (unsigned char *)symbol->bgcolour, strlen(symbol->bgcolour)) == ZINT_ERROR_INVALID_DATA)
|| (is_sane(TITANIUM, (unsigned char *)symbol->fgcolour, strlen(symbol->bgcolour)) == ZINT_ERROR_INVALID_DATA)) {
strcpy(symbol->errtxt, "233: Invalid characters in colour");
error_tag(symbol->errtxt, ZINT_ERROR_INVALID_OPTION);
return ZINT_ERROR_INVALID_OPTION;
}
switch (symbol->symbology) { switch (symbol->symbology) {
case BARCODE_QRCODE: case BARCODE_QRCODE:
case BARCODE_MICROQR: case BARCODE_MICROQR:
@ -1286,11 +1271,6 @@ int ZBarcode_Print(struct zint_symbol *symbol, int rotate_angle) {
return ZINT_ERROR_INVALID_OPTION; return ZINT_ERROR_INVALID_OPTION;
} }
if (error_number == ZINT_ERROR_INVALID_OPTION) {
/* If libpng is not installed */
strcpy(symbol->errtxt, "227: No PNG support - compile with libpng-devel to resolve");
}
error_tag(symbol->errtxt, error_number); error_tag(symbol->errtxt, error_number);
return error_number; return error_number;
} }