QtQR is a Qt based software that let's you generate QR Codes easily, scan an
image file for QR Codes and decode them or use your webcam to scan a printed one. WWW: https://launchpad.net/qr-tools
This commit is contained in:
parent
d59e12e9b4
commit
e3ffb1d2cb
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=542479
@ -908,6 +908,7 @@
|
||||
SUBDIR += qt5-wayland
|
||||
SUBDIR += qtawesome
|
||||
SUBDIR += qtpbfimageplugin
|
||||
SUBDIR += qtqr
|
||||
SUBDIR += quat
|
||||
SUBDIR += quat-gui
|
||||
SUBDIR += quesa
|
||||
|
39
graphics/qtqr/Makefile
Normal file
39
graphics/qtqr/Makefile
Normal file
@ -0,0 +1,39 @@
|
||||
# Created by: Emanuel Haupt <ehaupt@FreeBSD.org>
|
||||
# $FreeBSD$
|
||||
|
||||
PORTNAME= qtqr
|
||||
DISTVERSION= 2.0.bzr39
|
||||
CATEGORIES= graphics python
|
||||
MASTER_SITES= LOCAL/ehaupt
|
||||
DISTNAME= qr-tools-${DISTVERSION}
|
||||
|
||||
MAINTAINER= ehaupt@FreeBSD.org
|
||||
COMMENT= GUI that makes easy creating and decoding the QR Codes
|
||||
|
||||
LICENSE= GPLv3
|
||||
LICENSE_FILE= ${WRKSRC}/LICENCE
|
||||
|
||||
RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}zbar-py>=1.0.4:graphics/py-zbar-py@${PY_FLAVOR}
|
||||
|
||||
USES= desktop-file-utils pyqt:5 python:3.6+ shebangfix
|
||||
USE_PYQT= core_run gui_run network_run widgets_run
|
||||
USE_PYTHON= autoplist distutils
|
||||
|
||||
SHEBANG_FILES= qtqr.py
|
||||
|
||||
NO_BUILD= yes
|
||||
|
||||
OPTIONS_DEFINE= EXAMPLES
|
||||
|
||||
post-install:
|
||||
${INSTALL_SCRIPT} ${WRKSRC}/qtqr.py ${STAGEDIR}${PREFIX}/bin/qtqr
|
||||
${INSTALL_DATA} ${WRKSRC}/icon.png ${STAGEDIR}${PREFIX}/share/pixmaps/qtqr.png
|
||||
${INSTALL_DATA} ${WRKSRC}/qtqr.desktop ${STAGEDIR}${DESKTOPDIR}
|
||||
${MKDIR} ${STAGEDIR}${PREFIX}/share/qt5/translations
|
||||
${INSTALL_DATA} ${WRKSRC}/*.qm ${STAGEDIR}${PREFIX}/share/qt5/translations
|
||||
|
||||
post-install-EXAMPLES-on:
|
||||
${MKDIR} ${STAGEDIR}${EXAMPLESDIR}
|
||||
${INSTALL_DATA} ${WRKSRC}/samples/* ${STAGEDIR}${EXAMPLESDIR}
|
||||
|
||||
.include <bsd.port.mk>
|
3
graphics/qtqr/distinfo
Normal file
3
graphics/qtqr/distinfo
Normal file
@ -0,0 +1,3 @@
|
||||
TIMESTAMP = 1595005514
|
||||
SHA256 (qr-tools-2.0.bzr39.tar.gz) = 435d399839dedb93670bf85a306ac004fac4cc553f1de226fe0b769921b7224e
|
||||
SIZE (qr-tools-2.0.bzr39.tar.gz) = 280645
|
53
graphics/qtqr/files/patch-qrtools.py
Normal file
53
graphics/qtqr/files/patch-qrtools.py
Normal file
@ -0,0 +1,53 @@
|
||||
--- qrtools.py.orig 2020-07-15 18:00:04 UTC
|
||||
+++ qrtools.py
|
||||
@@ -29,6 +29,7 @@ import sys
|
||||
import time
|
||||
import shutil
|
||||
import hashlib
|
||||
+import numpy as np
|
||||
try:
|
||||
import zbar
|
||||
except ImportError:
|
||||
@@ -210,35 +211,19 @@ class QR(object):
|
||||
def decode(self, filename=None, image=None):
|
||||
self.filename = filename or self.filename
|
||||
if self.filename is not None or image is not None:
|
||||
- scanner = zbar.ImageScanner()
|
||||
- # configure the reader
|
||||
- scanner.parse_config('enable')
|
||||
- # obtain image data
|
||||
- if image is not None:
|
||||
- pil = image.convert('L')
|
||||
- else:
|
||||
- pil = Image.open(self.filename).convert('L')
|
||||
- width, height = pil.size
|
||||
- try:
|
||||
- raw = pil.tostring()
|
||||
- except:
|
||||
- raw = pil.tobytes()
|
||||
- # wrap image data
|
||||
- image = zbar.Image(width, height, 'Y800', raw)
|
||||
- # scan the image for barcodes
|
||||
+ image = np.array(Image.open(self.filename).convert('L'))
|
||||
+ scanner = zbar.Scanner()
|
||||
result = scanner.scan(image)
|
||||
+
|
||||
# extract results
|
||||
if result == 0:
|
||||
return False
|
||||
else:
|
||||
- for symbol in image:
|
||||
- pass
|
||||
- # clean up
|
||||
del(image)
|
||||
- #Assuming data is encoded in utf8
|
||||
- self.data = symbol.data
|
||||
- self.data_type = self.data_recognise()
|
||||
- return True
|
||||
+ for res in result:
|
||||
+ self.data = res.data.decode('utf8')
|
||||
+ self.data_type = self.data_recognise()
|
||||
+ return True
|
||||
else:
|
||||
return False
|
||||
|
5
graphics/qtqr/pkg-descr
Normal file
5
graphics/qtqr/pkg-descr
Normal file
@ -0,0 +1,5 @@
|
||||
QtQR is a Qt based software that let's you generate QR Codes easily, scan an
|
||||
image file for QR Codes and decode them or use your webcam to scan a printed
|
||||
one.
|
||||
|
||||
WWW: https://launchpad.net/qr-tools
|
23
graphics/qtqr/pkg-plist
Normal file
23
graphics/qtqr/pkg-plist
Normal file
@ -0,0 +1,23 @@
|
||||
bin/qtqr
|
||||
share/applications/qtqr.desktop
|
||||
share/pixmaps/qtqr.png
|
||||
share/qt5/translations/qtqr_de_DE.qm
|
||||
share/qt5/translations/qtqr_en_GB.qm
|
||||
share/qt5/translations/qtqr_es.qm
|
||||
share/qt5/translations/qtqr_es_AR.qm
|
||||
share/qt5/translations/qtqr_fr.qm
|
||||
share/qt5/translations/qtqr_is_IS.qm
|
||||
share/qt5/translations/qtqr_it_IT.qm
|
||||
share/qt5/translations/qtqr_ja.qm
|
||||
share/qt5/translations/qtqr_ru.qm
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/bookmark.png
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/email-address.png
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/email-message.png
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/geo.png
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/mms.png
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/phonebook.png
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/sms.png
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/telephone.png
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/text-non-ascii.png
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/text-plain.png
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/url.png
|
Loading…
Reference in New Issue
Block a user