Closed kalloc closed 5 years ago
I will look into it, probably over the weekend.
Did you have free time?
Sorry, I have been traveling and had other work. Before fixing, I'd like to find another another decoder to make sure the issue is with my encoding and not with their decoding. The one had time to try out (https://sourceforge.net/projects/pdf417decode/) did not work on my machine for some reason, would not recognize the barcode image format.
I'll try to find time to work on this soon, but can't promise you anything.
BTW, this reader gives a different decoding result, also different from input :/ https://online-barcode-reader.inliteresearch.com/
Not really. Working. See the issue.
-- Ivan
On Mon, 27 Feb 2017, at 14:57, kalloc wrote:
Did you have free time?
— You are receiving this because you commented. Reply to this email directly, view it on GitHub[1], or mute the thread[2].
Links:
1) we need working generator 2) as I understand, dynamsoft decoder works well
This file was successfully decoded in dynamsoft.com
I found valid coder.
def encode(data: bytes)-> bytes:
import zint
from ctypes import create_string_buffer, memmove
import PIL
import io
input = zint.instr(data)
symbol = zint.ZBarcode_Create()
symbol.contents.symbology = zint.BARCODE_PDF417
symbol.contents.option_1 = 4
symbol.contents.option_2 = 4
zint.ZBarcode_Encode_and_Buffer(symbol, input, len(input) - 1, 0)
BITMAP_SIZE = symbol.contents.bitmap_height * symbol.contents.bitmap_width * 3
buf = create_string_buffer(BITMAP_SIZE)
memmove(buf, symbol.contents.bitmap, BITMAP_SIZE)
im = PIL.Image.frombytes('RGB', (symbol.contents.bitmap_width, symbol.contents.bitmap_height), bytes(buf))
b = io.BytesIO()
im.save(b, format='PNG')
image = b.getvalue()
zint.ZBarcode_Delete(symbol)
return image
Hi.
I save bytes to pdf417
produced this image
When I check image on https://www.dynamsoft.com/Demo/DBR/BarcodeReaderDemo.aspx I got
011b0000f829a358e1610100000001005b9607c5186ce77de352648cfde9a15114305ebe39ed1db4940f3aa3cd89086ea5eb8db01fbe8255b0b0a5fbebca7a123859fc86f2ddfcb1abfd71e5