Giter Site home page Giter Site logo

pdf417decoder's People

Contributors

dangrie158 avatar jboarman avatar kwcckw avatar tbrettallen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pdf417decoder's Issues

Unable to install pdf417decoder

I am trying to install pdf417decoder. I am using command:
pip install pdf417decoder
but everytime I get following error :
ERROR: Could not find a version that satisfies the requirement pdf417decoder (from versions: none)
ERROR: No matching distribution found for pdf417decoder

Can you please help me out to install the package

Cannot decode barcodes which are not padded

I noticed that barcodes which don't have any padding cannot be decoded. I'm using the following code to test:

import sys
from PIL import Image
from pdf417decoder import PDF417Decoder

image = Image.open(sys.argv[1])
decoder = PDF417Decoder(image)

if decoder.decode() > 0:
    decoded = decoder.barcode_data_index_to_string(0)
    print(decoded)
else:
    print("cannot decode")

The following image cannot be decoded:
invalid

While the following image can:
valid

Images are the same, except that second image has 1px of white padding around the barcode, while the first image touches the image borders.

Error Decoding

Whenever I try to run the decoder.decode() dommand, I get the following error. Do you have any suggestions? Thanks!

UnboundLocalError: local variable 'codewords_ptr' referenced before assignment

pdf417 decoder failing to decode always

this is the code i tried :

from pdf417decoder import PDF417Decoder
import matplotlib.pyplot as plt
import cv2
from PIL import Image 
npimg = cv2.imread("/content/bar.png")
image = Image.fromarray(npimg)
plt.imshow(image)
decoder = PDF417Decoder(image)

if (decoder.decode() > 0):
    print('decoding')
    decoded = decoder.barcode_data_index_to_string(0)
else:
  print('could not decode')
  

for this high resolution image : https://i.ibb.co/SypTDfh/bar.png

also cropped the barcode region and tried again,,no luck,always failing to decode(returns nothing)

Mac Users -- pdf417decoder crashes upon import, with fix

Reading through the stack trace it appears it's looking for ffmpeg.

I don't know if this is something that can be fixed in this repo/library but I figured I'd report it so that it's known and what the fix is.

Issue

Computer: Apple MacBook Pro 16" with Apple Silicon M1
Running Python 3.9.6 in Terminal.app

>>> import pdf417decoder
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/python3.9/site-packages/pdf417decoder/__init__.py", line 1, in <module>
    from pdf417decoder.Decoder import PDF417Decoder
  File "/python3.9/site-packages/pdf417decoder/Decoder.py", line 4, in <module>
    import cv2
  File "/python3.9/site-packages/cv2/__init__.py", line 5, in <module>
    from .cv2 import *
ImportError: dlopen(/python3.9/site-packages/cv2/cv2.cpython-39-darwin.so, 2): Library not loaded: /opt/homebrew/opt/ffmpeg/lib/libavcodec.58.dylib
  Referenced from: /python3.9/site-packages/cv2/cv2.cpython-39-darwin.so
  Reason: image not found

Fix

I installed ffmpeg through Homebrew and it ran fine.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.