Giter VIP home page Giter VIP logo

hubarcode's People

Contributors

5263 avatar fdiary avatar gaqzi avatar paepke avatar schluete avatar vmihailenco 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  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  avatar  avatar

hubarcode's Issues

IndexError: list index out of range

My code as follows:

def create_qr_code_pic(data):
code_str = "!|"
code_str += data+"|"
code_str += "@"

(dir,file_name) = get_unique_file_name2(file_pre="qr")
code_image_path = os.path.join(settings.MEDIA_ROOT,'uploads',dir)
if not os.path.exists(code_image_path):
    os.mkdir(code_image_path)
code_image_file_name = '%s/%s.png' % (code_image_path, file_name)

ENCODER = QRCodeEncoder(code_str.encode('gbk'))
ENCODER.save(code_image_file_name)

return '%s/%s.png' % (dir, file_name)

and the error message:

...
File "/root/deploy/divo3/apps/check/views/commons.py", line 140, in create_qr_code_pic
ENCODER = QRCodeEncoder(code_str.encode('gbk'))

File "/usr/lib/python2.5/site-packages/hubarcode/qrcode/init.py", line 29, in init
self.matrix = enc.encode(text, ecl)

File "/usr/lib/python2.5/site-packages/hubarcode/qrcode/textencoder.py", line 83, in encode
self.create_matrix()

File "/usr/lib/python2.5/site-packages/hubarcode/qrcode/textencoder.py", line 207, in create_matrix
matrix_content = self.minfo.create_matrix(self.version, self.codewords)

File "/usr/lib/python2.5/site-packages/hubarcode/qrcode/isodata.py", line 109, in create_matrix
codeword_i = codewords[i]

IndexError: list index out of range

Re-size datamatrix?

Hi,

I can get the data matrix images in a 80x80 pixel format but i'm not able to change the size of this image either increase or decrease the image by , lets say 50%(40x40 pixel) or 150%(120x120 pixel).

i have tried altering the .height and .width parameter but i think they are for bar codes and not for data matrix.

is there a solution for this?

Python 3.x Port

Sir,
First of all I would really like to thank you for making such a nice and good script for developing 2D barcodes and keeping it in open license formats.
Actually I am trying to build a simple application for myself, and for a kind of secrecy, I want the answers (output) to be printed and circulated using the datamatrix encodings. As the datamatrix encoding procedure is defined by ISO and is not freely available, I looked upon your code for help.
I have seen the examples and it was really easy to understand how to implement your script. But the problem is I have dealt with python in only its 3.x version and I do not know much about 2.x It would be really helpful if you could tell, till when would you release the script in 3.x or help in converting the present script (only the datamatrix part) in 3.x
Thank you very much for reading my mail,
Ayush
3rd yr,
B.E., Computer department

Delhi College of Engineering

Some code128 barcodes are missing the last character

This code produces the same bardcodes (the readable text changes, but the barcodes are the same). The first is missing the 9.

from hubarcode.code128 import Code128Encoder

encoder = Code128Encoder('123456789')
encoder.save('test1.png')

encoder = Code128Encoder('12345678')
encoder.save('test2.png')

qr broken due to data installation

this took me a while to figure out:

the qrcode implementation won't work if installed via the current trunk , because the qrcode_data directory isn't installed along with it.

the qrcode_generate_Data.py script doesn't seem to work either, because it doesn't like the way stuff is laid out

my inelegant fix was to migrate the qrcode_data that was in trunk into the python egg.

Crash during QR-Code generation

hongshan liu writes:

hi,Maximillian Dornseif,
I was using your huBarcode,but I found some bugs when I using it.

bug example1:
# -- coding: utf-8 --
# author: liu hongshan email: hongshan.liu@...
from hubarcode.qrcode import QRCodeEncoder
if name == "main":
test = "12345"
ENCODER = QRCodeEncoder(test)
ENCODER.save( "test.png",3)

bug info:
File "/home/works/hudora-huBarcode-7a9d83e/hubarcode/qrcode/textencoder.py", line 207, in create_matrix
matrix_content = self.minfo.create_matrix(self.version, self.codewords)
File "/home/works/hudora-huBarcode-7a9d83e/hubarcode/qrcode/isodata.py", line 109, in create_matrix
codeword_i = codewords[i]
IndexError: list index out of range

could you fix these? thank you!

New release?

Any chance we can get a new release cut and uploaded to PyPI? It's been two years since the last one, and certain changes (#16 in particular) would be nice to have. Thanks!

Invalid QR-Codes generated

hongshan liu writes:

hi,Maximillian Dornseif,
I was using your huBarcode,but I found some bugs when I using it.

bug example2:
# -- coding: utf-8 --
# author: liu hongshan email: [email protected]
from hubarcode.qrcode import QRCodeEncoder
if name == "main":
test = "TEL:13516190008" #i found when len(test)==15,the result image could not be decoded!
ENCODER = QRCodeEncoder(test)
ENCODER.save( "test.png",3)

could you fix these? thank you!

Documentation?

It would be nice if there was some usage documentation for this library! Specifically options and import steps would be appreciated.

Package does not install properly when using PIP

When using pip install huBarcode, sub-packages are installed in root lib dir.

Example:
/usr/local/lib/python2.6/dis-packages/code128

Should be
/usr/local/lib/python2.6/dis-packages/hubarcode/code128

Also, 'fonts' directory is not installed.

unable to render raw image string for qrcode

I'm having trouble render an image of QR code (works for DataMatrix).

from hubarcode.qrcode import QRCodeEncoder

qr = QRCodeEncoder("m103")
qr_raw_ascii = qr.get_ascii()
print(qr_raw_ascii) # works
qr_raw_img = qr.get_imagedata()
print(qr_raw_img) # prints error listed below
Traceback (most recent call last):
  File "D:/py_workspace/otf_barcode/source/test", line 6, in <module>
    qr_raw_img = qr.get_imagedata()
  File "C:\Python27\lib\site-packages\hubarcode\qrcode\__init__.py", line 44, in get_imagedata
    imagedata = qrc.get_imagedata(cellsize)
  File "C:\Python27\lib\site-packages\hubarcode\qrcode\renderer.py", line 53, in get_imagedata
    img = self.get_pilimage(cellsize)
  File "C:\Python27\lib\site-packages\hubarcode\qrcode\renderer.py", line 33, in get_pilimage
    self.add_border(colour=0, width=4)
  File "C:\Python27\lib\site-packages\hubarcode\qrcode\renderer.py", line 26, in add_border
    for i in range(0, self.mtx_size - (width * 2))]
IndexError: list index out of range

Am I doing something wrong?

Isn't compatible with Python3 (but almost)

Too bad huBarcode doesn't work with Python3.

I'd submit a patch, but I'm pretty new to libraries and git too so... here is what I did to make huBarcode work for python3 (or... at least the parts I need to generate a datamatrix):

  • Example from "hubarcode/datamatrix/init.py":
    from textencoder import TextEncoder
    Must be replaced by this:
    from .textencoder import TextEncoder
    This is only an example. Almost every .py-File needs to be update
  • Example from "hubarcode/datamatrix/placement.py", line 105:
    def place_standard_shape(self, (posx, posy), codeword):
    Must be replaced with:
    def place_standard_shape(self, posx_posy, codeword):
    posx, posy = posx_posy
  • "hubarcode/datamatrix/renderer.py", the StringIO has been restructured. To Import it in a Python2 and Python3 compatible way use:

try:
from StringIO import StringIO
except ImportError:
from io import StringIO

  • Last but not least, remember to install Pillow instead of PIL as PIL isn't Python3 compatible either.

hubarcode/qrcode/qrcode_data not exists

It appears that the install problem not copy hubarcode/qrcode/qrcode_data dir to '/usr/lib/python2.5/site-packages/huBarcode-0.61_r0-py2.5.egg/hubarcode/qrcode/qrcode_data/'.

Import failure when using datamatrix

I've downloaded the latest version of huBarcode from the cheeseshop, and when I attempt to follow the datamatrix sample in the python interpreter, I get an import error.

>>> from hubarcode.datamatrix import DataMatrixEncoder
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "c:\python27\lib\site-packages\hubarcode-0.63-py2.7.egg\hubarcode\datamatrix\__init__.py
", line 39, in <module>
    from renderer import DataMatrixRenderer
  File "c:\python27\lib\site-packages\hubarcode-0.63-py2.7.egg\hubarcode\datamatrix\renderer.py
", line 6, in <module>
    import Image
ImportError: No module named Image

Is there a dependency I'm not aware of?

Create a new release tag for current version.

I use this software and our legal page attributes the correct license. I'm writing a dynamic way of getting the licenses for current versions of the packages we use. One of the strategies is pulling the LICENSE file for a given version from release branches on github or whatever hosting provider the project in question is using.

Currently, the latest (and only) release branch tagged on this project is 0.6.2, even though the PyPI package and commit comments indicate that 0.63 is the latest version. A simple version bump tag would be in order.

Also, the versioning convention should be reviewed and sync'd between github and PyPI. I imagine the "current" version is supposed to be 0.6.3 rather than 0.63.

Conflicting license information

This package has conflicting license information.

On one hand, the README file states the following:

The code is available under the Apache License, Version 2.0.

On the other, the setup.py file contains the following:

'License :: OSI Approved :: BSD License',

And the README also contains this:

If you worry about copyright you might consider this Software BSD-Licensed.
If you are still worried, you might consider it GPL1/2/3 compatible.

If this package is Apache 2.0 licensed, this is incorrect; the Apache 2.0 license is not compatible with versions of the GPL before v3.

I'd recommend picking a single license, placing the license text in a LICENSE file, and changing all references in the README, setup.py, and elsewhere to match.

Documentation on format

Would it be possible to add the possible list of export format? I'm particularly interested to know if it could export as EPS format or SVG format. Thanks!

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.