From d817d2202176d345249f536622883102599e970c Mon Sep 17 00:00:00 2001 From: Kazuki Suzuki Przyborowski Date: Wed, 20 Nov 2024 20:44:29 -0600 Subject: [PATCH] Small bug fix --- upcean/encode/codabar.py | 2 +- upcean/encode/code11.py | 2 +- upcean/encode/code32.py | 2 +- upcean/encode/code39.py | 4 ++-- upcean/encode/code93.py | 4 ++-- upcean/encode/itf.py | 2 +- upcean/encode/itf14.py | 2 +- upcean/encode/msi.py | 2 +- upcean/encode/plessey.py | 2 +- upcean/encode/stf.py | 2 +- 10 files changed, 12 insertions(+), 12 deletions(-) diff --git a/upcean/encode/codabar.py b/upcean/encode/codabar.py index 81bcf92b..abcc2b6c 100644 --- a/upcean/encode/codabar.py +++ b/upcean/encode/codabar.py @@ -271,7 +271,7 @@ def encode_codabar_barcode(inimage, upc, resize=1, shiftxy=(0, 0), barheight=(48 LineTxtStart += (1 * int(resize)) while (NumTxtZero < len(upc_matches)): texthidden = False - if hidetext or (NumTxtZero == 0 and (hidesn is None or hidesn)) or (NumTxtZero == 11 and (hidecd is None or hidecd)): + if hidetext: texthidden = True if(not texthidden): drawColorText(upc_img, 10 * int(resize * barwidth[1]), LineTxtStart * barwidth[0], vertical_text_fix + ( diff --git a/upcean/encode/code11.py b/upcean/encode/code11.py index e8976ce4..77daeb24 100644 --- a/upcean/encode/code11.py +++ b/upcean/encode/code11.py @@ -230,7 +230,7 @@ def encode_code11_barcode(inimage, upc, resize=1, shiftxy=(0, 0), barheight=(48, LineTxtStart += (1 * int(resize)) while (NumTxtZero < len(upc_print)): texthidden = False - if hidetext or (NumTxtZero == 0 and (hidesn is None or hidesn)) or (NumTxtZero == 11 and (hidecd is None or hidecd)): + if hidetext: texthidden = True if(not texthidden): drawColorText(upc_img, 10 * int(resize * barwidth[1]), LineTxtStart * barwidth[0], vertical_text_fix + ( diff --git a/upcean/encode/code32.py b/upcean/encode/code32.py index 98b86d55..175eede3 100644 --- a/upcean/encode/code32.py +++ b/upcean/encode/code32.py @@ -271,7 +271,7 @@ def encode_code32_barcode(inimage, upc, resize=1, shiftxy=(0, 0), barheight=(48, LineTxtStart += (1 * int(resize)) while (NumTxtZero < len(upc_matches)): texthidden = False - if hidetext or (NumTxtZero == 0 and (hidesn is None or hidesn)) or (NumTxtZero == 11 and (hidecd is None or hidecd)): + if hidetext: texthidden = True if(not texthidden): drawColorText(upc_img, 10 * int(resize * barwidth[1]), LineTxtStart * barwidth[0], vertical_text_fix + ( diff --git a/upcean/encode/code39.py b/upcean/encode/code39.py index b7a0089c..e348e82b 100644 --- a/upcean/encode/code39.py +++ b/upcean/encode/code39.py @@ -300,7 +300,7 @@ def encode_code39_barcode(inimage, upc, resize=1, shiftxy=(0, 0), barheight=(48, LineTxtStartNorm += 15 while (NumTxtZero < len(upc_matches)): texthidden = False - if hidetext or (NumTxtZero == 0 and (hidesn is None or hidesn)) or (NumTxtZero == 11 and (hidecd is None or hidecd)): + if hidetext: texthidden = True if(not texthidden): drawColorText(upc_img, 10 * int(resize * barwidth[1]), LineTxtStart * barwidth[0], vertical_text_fix + ( @@ -634,7 +634,7 @@ def encode_code39extended_barcode(inimage, upc, resize=1, shiftxy=(0, 0), barhei else: drawColorText(upc_img, 10 * int(resize * barwidth[1]), LineTxtStart * barwidth[0], vertical_text_fix + ( barheight[0] * int(resize)), code39extended.get(upc_matches[NumTxtZero], upc_matches[NumTxtZero]), barcolor[1], "ocrb", imageoutlib) - if hidetext or (NumTxtZero == 0 and (hidesn is None or hidesn)) or (NumTxtZero == 11 and (hidecd is None or hidecd)): + if hidetext: texthidden = True if(not texthidden): drawColorText(upc_img, 10 * int(resize * barwidth[1]), LineTxtStart * barwidth[0], vertical_text_fix + ( diff --git a/upcean/encode/code93.py b/upcean/encode/code93.py index 09554123..8bc2cc00 100644 --- a/upcean/encode/code93.py +++ b/upcean/encode/code93.py @@ -301,7 +301,7 @@ def encode_code93_barcode(inimage, upc, resize=1, shiftxy=(0, 0), barheight=(48, LineTxtStart += (1 * int(resize)) while (NumTxtZero < len(upc_matches)): texthidden = False - if hidetext or (NumTxtZero == 0 and (hidesn is None or hidesn)) or (NumTxtZero == 11 and (hidecd is None or hidecd)): + if hidetext: texthidden = True if(not texthidden): drawColorText(upc_img, 10 * int(resize * barwidth[1]), LineTxtStart * barwidth[0], vertical_text_fix + ( @@ -636,7 +636,7 @@ def encode_code93extended_barcode(inimage, upc, resize=1, shiftxy=(0, 0), barhei else: drawColorText(upc_img, 10 * int(resize * barwidth[1]), LineTxtStart * barwidth[0], vertical_text_fix + ( barheight[0] * int(resize)), code93extended.get(upc_matches[NumTxtZero], upc_matches[NumTxtZero]), barcolor[1], "ocrb", imageoutlib) - if hidetext or (NumTxtZero == 0 and (hidesn is None or hidesn)) or (NumTxtZero == 11 and (hidecd is None or hidecd)): + if hidetext: texthidden = True if(not texthidden): drawColorText(upc_img, 10 * int(resize * barwidth[1]), LineTxtStart * barwidth[0], vertical_text_fix + ( diff --git a/upcean/encode/itf.py b/upcean/encode/itf.py index f87944e0..6a903dee 100644 --- a/upcean/encode/itf.py +++ b/upcean/encode/itf.py @@ -297,7 +297,7 @@ def encode_itf_barcode(inimage, upc, resize=1, shiftxy=(0, 0), barheight=(48, 54 while (NumTxtZero < len(upc_matches)): ArrayDigit = list(upc_matches[NumTxtZero]) texthidden = False - if hidetext or (NumTxtZero == 0 and (hidesn is None or hidesn)) or (NumTxtZero == 11 and (hidecd is None or hidecd)): + if hidetext: texthidden = True if(not texthidden): drawColorText(upc_img, 10 * int(resize * barwidth[1]), LineTxtStart * barwidth[0], vertical_text_fix + ( diff --git a/upcean/encode/itf14.py b/upcean/encode/itf14.py index f159013a..2ba5bdf2 100644 --- a/upcean/encode/itf14.py +++ b/upcean/encode/itf14.py @@ -305,7 +305,7 @@ def encode_itf14_barcode(inimage, upc, resize=1, shiftxy=(0, 0), barheight=(48, while (NumTxtZero < len(upc_matches)): ArrayDigit = list(upc_matches[NumTxtZero]) texthidden = False - if hidetext or (NumTxtZero == 0 and (hidesn is None or hidesn)) or (NumTxtZero == 11 and (hidecd is None or hidecd)): + if hidetext: texthidden = True if(not texthidden): drawColorText(upc_img, 10 * int(resize * barwidth[1]), LineTxtStart * barwidth[0], vertical_text_fix + ( diff --git a/upcean/encode/msi.py b/upcean/encode/msi.py index d586261b..3a5c9c3a 100644 --- a/upcean/encode/msi.py +++ b/upcean/encode/msi.py @@ -211,7 +211,7 @@ def encode_msi_barcode(inimage, upc, resize=1, shiftxy=(0, 0), barheight=(48, 54 LineTxtStart += (1 * int(resize)) while (NumTxtZero < len(upc_print)): texthidden = False - if hidetext or (NumTxtZero == 0 and (hidesn is None or hidesn)) or (NumTxtZero == 11 and (hidecd is None or hidecd)): + if hidetext: texthidden = True if(not texthidden): drawColorText(upc_img, 10 * int(resize * barwidth[1]), LineTxtStart * barwidth[0], vertical_text_fix + ( diff --git a/upcean/encode/plessey.py b/upcean/encode/plessey.py index 72bc9c2a..e0bab39a 100644 --- a/upcean/encode/plessey.py +++ b/upcean/encode/plessey.py @@ -239,7 +239,7 @@ def encode_plessey_barcode(inimage, upc, resize=1, shiftxy=(0, 0), barheight=(48 LineTxtStart += (1 * int(resize)) while (NumTxtZero < len(upc_matches)): texthidden = False - if hidetext or (NumTxtZero == 0 and (hidesn is None or hidesn)) or (NumTxtZero == 11 and (hidecd is None or hidecd)): + if hidetext: texthidden = True if(not texthidden): drawColorText(upc_img, 10 * int(resize * barwidth[1]), LineTxtStart * barwidth[0], vertical_text_fix + ( diff --git a/upcean/encode/stf.py b/upcean/encode/stf.py index be9d5b12..014a9bfc 100644 --- a/upcean/encode/stf.py +++ b/upcean/encode/stf.py @@ -248,7 +248,7 @@ def encode_stf_barcode(inimage, upc, resize=1, shiftxy=(0, 0), barheight=(48, 54 LineTxtStart += (1 * int(resize)) while (NumTxtZero < len(upc_matches)): texthidden = False - if hidetext or (NumTxtZero == 0 and (hidesn is None or hidesn)) or (NumTxtZero == 11 and (hidecd is None or hidecd)): + if hidetext: texthidden = True if(not texthidden): drawColorText(upc_img, 10 * int(resize * barwidth[1]), LineTxtStart * barwidth[0], vertical_text_fix + (