Giter Club home page Giter Club logo

qzxing's People

Contributors

alexxey593 avatar antonio-111 avatar arminfelder avatar astillich-igniti avatar barto-paja avatar betsymcphail avatar chalker avatar dkormalev avatar dobey avatar dseight avatar eism avatar err4nt avatar fredldotme avatar ftylitak avatar handsomejaack avatar kanglin avatar kanocz avatar milerius avatar milianw avatar neutrinoyu avatar nickdiego avatar okcerg avatar promag avatar sashao avatar sergey-platonov avatar sj avatar stefandio avatar stefanod avatar thaodan avatar vpicaver 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  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

qzxing's Issues

module "QZXing" is not installed in qml at QT plateform

@ftylitak
Hi
i succesfully compile the code and i added qzxing folder inside my project but when i run the code QR code is not generated in qml side.

during runtime i get this error: module "QZXing" is not installed

can you please look at my code when i did mistake

more ever my contain of code is this

in my .pro file i added this

CONFIG += qzxing_qml
CONFIG += staticlib

include(QZXing/QZXing.pri)

HEADERS += \
    \home\path\of\my\system\qmlqrcode\qzxing\src \

main.cpp file

#include <QGuiApplication>
#include <QQmlApplicationEngine>
#include <QZXing.h>

int main(int argc, char *argv[])
{
    QGuiApplication app(argc, argv);

    QQmlApplicationEngine engine;
    engine.load(QUrl(QStringLiteral("qrc:/main.qml")));


    QString data = "text to be encoded";
    QImage barcode = QZXing::encodeData(data);


    return app.exec();
}

main.qml file

import QtQuick 2.7
import QtQuick.Window 2.2
import QZXing 2.3

Window {
    visible: true
    width: 640
    height: 480
    title: qsTr("Hello World")

    Text {
        text: qsTr("Hello World")
        anchors.centerIn: parent
    }

    Image{
        source: "image://QZXing/encode/" + inputField.text;
        cache: false;
    }
}

Captured image mirrored on QZXing::decodeImage

Using QZXingLive on Android is impossible to decode QR CODE because the QImage passed to QZXing::decodeImage is mirrored.
To check I simply added:

    image.save("/storage/emulated/0/bbbb.jpg", "JPG");

on the top of decodeImage then opened with a filemanager.
Code 39 is decoded without problem because the image is rotated while decoding but QR CODE has 2 dimensions so rating doesn't solve because of it's mirrored.

QtQuick 2 example required

Hello there.

I think it would be very useful to provide qtquick2 example. Docs are lacking details. What below comment means?
I found Image provider but its not related to Camera Element in any way.

   * The decoding function accessible from QML. (Suggested for Qt 5.x)

     * Can be used to decode image from the Camera element preview by providing

     * the following string: image://camera/preview_1

     */

    QString decodeImageQML(const QUrl &imageUrl);

Building requirements

These packages I had to install in Ubuntu 16.04 compile QZXingLive:

  • qt5-default
  • qtdeclarative5-dev
  • qtmultimedia5-dev
  • qml-module-qtmultimedia
  • qml-module-qtquick-layouts
  • qml-module-qtquick-dialogs
  • qml-module-qtquick-controls

Additionally, I had to yank the line #include <qzxing.h> from main.cpp.

Encoding is broken

Result of
QImage QZXing::encodeData(const QString& data)
is incorrect QR Code. Even zxing site can't recognize it.

MaskUtil 'max' is no element of 'std'

When compiling QZXing with Qt 5.9.2 and MSVC2017 64bit(Visual C++ Compiler 15.0) the following error is occuring in MaskUtil.cpp several times:

C2039: "max" is not an element of "std".

I could fix this by including <algorithm> in MaskUtil.cpp

The strange thing is, this error never occured before. This is just occuring after reinstalling by build environment and yet it seems to me like this is a real issue and not a environmental one.

QtCore: No such file or directory

I get "QtCore: No such file or directory" when I try building my project. If I remove "CONFIG += qzxing_qml" everything works fine but I want to use QML. My Qt version is 5.9 and I tried to build on Ubuntu GCC 64 bit
Here is my .pro file

    QT += qml quick

    CONFIG += qt c++11

    SOURCES += main.cpp

    RESOURCES += qml.qrc

    QML_IMPORT_PATH =

    QML_DESIGNER_IMPORT_PATH =
    DEFINES += QT_DEPRECATED_WARNINGS

    CONFIG += qzxing_qml
    include(src/QZXing.pri)
    qnx: target.path = /tmp/$${TARGET}/bin
    else: unix:!android: target.path = /opt/$${TARGET}/bin
    !isEmpty(target.path): INSTALLS += target

Build QZXing cavetas

Hi
There are two major cavetas when we want to build QZXing:

  1. there is no mention around about necessity of adding that line:
    CONFIG += qzxing_qml qzxing_multimedia
    To QZXing.pro in the case we want use it as dll (contrary to just include pri file). Without this line QZXing is pretty useless.
  2. there is no mention around about necessity of adding that line:
    DEFINES += QZXING_QML QZXING_MULTIMEDIA
    To the application pro file. Without it we will be confused with "unresolved externals" errors when try to compile.
    This should be added to the README.md file.

Other confusing thing is "official" release (currently from past year) - I don't found it very useful: no examples it also lack some files... So I decide to use master branch from github.

thanks and best regards
Jacek

QZXing without QML - Including QML headers

When setting the QZXing pri to not add QML:

CONFIG -= qzxing_qml

In QZXing.cpp and ImageHandler.cpp there are QML related include files outside #ifdef QZXING_QML scope. This will cause errors if project does not include QML.

Unable to decode not centered code

Hello,

I'm using a webcam for reading data matrix codes. The image size is 640x480. If the code is in the center of the image, the code will be decoded. But not if its at the corner or else.

Memory increase in Debug

Hello,

the memory increase in Debug, but not in Release, when I'm using decodeImage(). In Release its alternating but not going up like in Debug.

Binary data

Hello, thanks for providing this library. I'm using Data Matrix codes containing binary data. Is it somehow possible to get a QByteArray instead of a QString back from decodeImage?

module "QZXing" is not installed

Probably something I missed, but I keep getting this QML error (module "QZXing" is not installed) when attempting to run QMLBarcodeScanner example (on Mac). The example compiles and links without error, but I figure I am not picking up a library somewhere (for QML).

NOTE: I actually ported the example provided to use the latest "declarative-camera" QT 5.9.4 example as a base, as the older QZXing example code was using the obsolete declarative module.

Any help would be appreciated.

Thanks.

QML: decoder.foundedFormat() is Empty

Thanks for awesome project!

Trying example on Qt5.9 ARM (Android) on test QrCode

decoder {
    enabledDecoders: QZXing.DecoderFormat_QR_CODE |
                     QZXing.DecoderFormat_PDF_417 |
                     QZXing.DecoderFormat_DATA_MATRIX |
                     QZXing.DecoderFormat_Aztec

    onTagFound: {
        console.log(tag + " | " + decoder.foundedFormat() + " | " + decoder.charSet());
    }

    tryHarder: false
}

Shows

(onTagFound): qml: TestTag |  | ISO8859-1

Where foundedFormat is empty, any help?

Alias to property QZXingFilter.decoder.enabledDecoders hangs app!

Hi!
I have alias to property for QZXingFilter.decoder.enabledDecoders. And when I write default value to this alias my app hangs! I am not sure whether is this qml bug or qzxing. So I ask you first before I report this to the Qt.

My alias is declared:

Base {
    property alias codes: zxingFilter.codes
    codes: QZXing.DecoderFormat_EAN_8 | QZXing.DecoderFormat_EAN_13 | QZXing.DecoderFormat_CODE_128 | QZXing.DecoderFormat_CODE_39 | QZXing.DecoderFormat_QR_CODE
    

    QZXingFilter
    {
    ,,,
       decoder {
            id: decoder1
    ....
    }
}

Base is my page/window base class.

And when I write directly this default codecs - then it works!

        decoder {
            id: decoder1
            enabledDecoders: QZXing.DecoderFormat_EAN_8 | QZXing.DecoderFormat_EAN_13 | QZXing.DecoderFormat_CODE_128 | QZXing.DecoderFormat_CODE_39 | QZXing.DecoderFormat_QR_CODE

But I don't want do it in that way - because I want to make generic interface to my qml class (window/page).

Better encoding API from QML

Currently when we want to encode a QRCode from QML we call qzxing.encode(data) and access it with an image provider at source: "image://QZXing/latestEncoded".

This can be made more declarative by modifying the image provider to be able to do source: image://QZXing/data, others parameter than the data could also be passed if needed in the future (format, error correction, ...).

This has 2 more advantages, when changing the encoded data you don't have to reset the source (emptying it and resetting to the same url) to update the image, and you can display 2 different encoded codes at the same time easily.

If you feel this is a good idea, I could contribute a PR (I already have a PoC working).

CharacterSetECI has memory leaks!

follow is my patch:

 src/zxing/zxing/common/CharacterSetECI.h | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/zxing/zxing/common/CharacterSetECI.h b/src/zxing/zxing/common/CharacterSetECI.h
index 95ea86f..99c4883 100644
--- a/src/zxing/zxing/common/CharacterSetECI.h
+++ b/src/zxing/zxing/common/CharacterSetECI.h
@@ -20,6 +20,7 @@
  */
 
 #include <map>
+#include <vector>
 #include <zxing/DecodeHints.h>
 
 namespace zxing {
@@ -29,8 +30,10 @@ class CharacterSetECI {
 private:
   static std::map<int, CharacterSetECI*> VALUE_TO_ECI;
   static std::map<std::string, CharacterSetECI*> NAME_TO_ECI;
-  static const bool inited;
+  static std::vector<CharacterSetECI*> ECItables;
+  static bool inited;
   static bool init_tables();
+  static void removeAllCharacterSets();
 
   int const* const values_;
   char const* const* const names_;
 src/zxing/zxing/common/CharacterSetECI.cpp | 20 ++++++++++++++++++--
 1 file changed, 18 insertions(+), 2 deletions(-)

diff --git a/src/zxing/zxing/common/CharacterSetECI.cpp b/src/zxing/zxing/common/CharacterSetECI.cpp
index 8386208..675d462 100644
--- a/src/zxing/zxing/common/CharacterSetECI.cpp
+++ b/src/zxing/zxing/common/CharacterSetECI.cpp
@@ -27,7 +27,8 @@ using zxing::IllegalArgumentException;
 std::map<int, CharacterSetECI*> CharacterSetECI::VALUE_TO_ECI;
 std::map<std::string, CharacterSetECI*> CharacterSetECI::NAME_TO_ECI;
 
-const bool CharacterSetECI::inited = CharacterSetECI::init_tables();
+std::vector<CharacterSetECI*> CharacterSetECI::ECItables;
+bool CharacterSetECI::inited = CharacterSetECI::init_tables();
 
 #define ADD_CHARACTER_SET(VALUES, STRINGS) \
   { static int values[] = {VALUES, -1}; \
@@ -64,6 +65,7 @@ bool CharacterSetECI::init_tables() {
   ADD_CHARACTER_SET(28, "Big5");
   ADD_CHARACTER_SET(29, "GB18030" XC "GB2312" XC "EUC_CN" XC "GBK");
   ADD_CHARACTER_SET(30, "EUC_KR" XC "EUC-KR");
+  atexit(removeAllCharacterSets);
   return true;
 }
 
@@ -89,7 +91,21 @@ int CharacterSetECI::getValue() const {
 }
 
 void CharacterSetECI::addCharacterSet(int const* values, char const* const* names) {
-  new CharacterSetECI(values, names);
+  ECItables.push_back(new CharacterSetECI(values, names));
+}
+
+void CharacterSetECI::removeAllCharacterSets()
+{
+	VALUE_TO_ECI.clear();
+	NAME_TO_ECI.clear();
+
+	for (std::vector<CharacterSetECI*>::iterator i=ECItables.begin();i!=ECItables.end();i++)
+	{
+		delete *i;;
+	}
+	ECItables.clear();
+
+	inited=false;
 }
 
 CharacterSetECI* CharacterSetECI::getCharacterSetECIByValue(int value) {

QZXingLive pixel format

The camera here natively produces 'GBRG' only, according to v4l2-ctl --all
Yet, QZXingLive fails, because it is fed Format_YUV420P.
Can I instruct it to use a working format conversion?

Camera preview very slow on Android

Hi, when using qzxinglive on Android the camera preview is very slow (the video jerks).
On my Samsung S3 Neo is noteworthy, on a Nexus S5 is less evident but still perceivable. It seems like the process is taking a lot of CPU. Have you ever noticed this problem?

QZXingLive unable to decode if image format is RGB32

There is an issue in the creation of the image of RGB32.
The issue is already fixed, though i have not yet commited it. This issue is made for tracking reasons.

The issue is that when the image is of format RGB32, it is processed as if it was RGB24 which resulted in wrong image. Moreover, the data buffer provided by the filter as frame has 'y' inverted, resulting horizontally flipped image.

Runtime crash on Android

Hello everyone,

I use the QZxing library with openCV in my application. It works fine on Linux, macOS and Android x86, but unfortunately not on Android ARMv7, it fails with the next error
F libc : Fatal signal 6 (SIGABRT), code -6 in tid 29269 (ThreadQrReader)

This crash happens when openCV has detected QR code and propagate it to the QZXing library. If QR, then QZXing library tries to decode QImage with QR and crashes (not always but in 80-90%).

I tried to narrow the problem context and started to use only decoder for QR - DecoderFormat_QR_CODE. So, it helped a bit but still I have some crashes on decoding.

Then I done another test and fully removed openCV library from my application. I use prepared images (with correct QR codes and some images without QR or corrupted QR) and pass the to a QZXing library. All works fine, when image doesn't contain QR or QR corrupted the QZXing library returns empty string - which is nice, otherwise it returns decoded text.

So, my assumption that openCV and QZXing library works unstable on Android ARMv7 and I don't know how to fix it.

I thought that the problem can be in emitting exceptions from QZXing lib, but I can't prove it and not sure why it works fine on Android x86.

Wont recognize QZXing.h

Hi.

I've successfully compile the library on a raspberry pi and add it to my project, but when I try to include it QT won't recognize it.

Any idea here.

Best Regards,
Daniel Tavares

about QZXingLive + iOS

First of all this is great project!
I downloaded example and tried QZXingLive.
I was able to successfully decode bar code with no problem.

I did not modify any source code in example code.
I did add info.plist to enable camera.

I had no success so far on decoding QRCode.
I am using iphone 7+ as test device.
below is a snippet of qml debug print.

Please advise on what I might be missing.

J

160.37708830548917 419
qml: frame finished: false 120 160.28095238095227 420
qml: frame finished: false 120 160.1852731591448 421
qml: frame finished: false 902 161.9431279620852 422

Extra characters in the decoded text

Hi,

I have been playing around with QZXing to create a bar code scanner application. It works perfectly for the most part. But I have noticed an odd behavior with the library.

Whenever I try to decode a code which has a ( as the first character, the decoded text has a ]C in the beginning.
INPUT: (01)95012345678903(3103)000123
OUTPUT ]C01950123456789033103000123

As you can see, there is no issue with a ( character that occurs in the middle of the code. I have enabled all DecoderFormats in my code.

Is this a known issue or am I doing something wrong?

QR code not decoded but zxing webpage does

qr2
The attached QR code can not be decoded by this library, however when I upload the same file to https://zxing.org/w/decode.jspx it works.
The text encoded is "Hallo Martin".

What I find strange is when I scan this picture with my Android mobile using "QR Droid" (which also uses ZXing) it can decode it. Then I let the decoded text now be encoded again with "QR Droid", but the resulting image is different (although both versions can be decoded by QR Droid).

Problem running QZXingLive Example

Hello
I am just unable to run the QZXingLive Example.
I have been following up issues related to this example in this repository.
I am using Qt5.7 on Ubuntu with Latest Android Build Sdk : android-26.
Tried using gradle.. i get this error.

Warning: QML import could not be resolved in any of the import paths: QZXing
Warning: QML import could not be resolved in any of the import paths: QtQuick.Controls.Material.impl
Warning: QML import could not be resolved in any of the import paths: QtQuick.Controls.impl
Warning: QML import could not be resolved in any of the import paths: QtQuick.Controls.Universal.impl

FAILURE: Build failed with an exception.

  • Where:
    Build file '/home/kaushik/QtProjects/QZingLive-Android-Release/android-build/build.gradle' line: 17

  • What went wrong:
    A problem occurred evaluating root project 'android-build'.

java.lang.UnsupportedClassVersionError: com/android/build/gradle/AppPlugin : Unsupported major.minor version 52.0

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Tried to build using ant but get this error.
BUILD FAILED
/home/kaushik/Android/android-sdk-linux/tools/ant/build.xml:649: The following error occurred while executing this line:
/home/kaushik/Android/android-sdk-linux/tools/ant/build.xml:694: null returned: 139

I just need to get this example working so that I can use this in my application.

Thanks for your time.

INTMAX_MAX undeclared identifier in ratio

When compiling QZXing with Qt 5.9.2 and MSVC2017 64bit(Visual C++ Compiler 15.0) a bunch of errors are occuring in "ratio" and "chrono". One of them is:

"C2065: "INTMAX_MAX": undeclared identifier

QZXing ships with a version of stdint.h. In this, the define segment
#if !defined(__cplusplus) || defined(__STDC_LIMIT_MACROS)
starting at line 131 is grey. Therefore INTMAX_MAX is truely undefined.

By manually adding
#define __STDC_LIMIT_MACROS
in before of line 131, i could manage to get all ratio and chrono errors removed.

Tracking changes from zxing-java and zxing-cpp

As this a wrapper of the c++ fork of the java-based zxing, but zxing-cpp is included as source code, I would like to ask about your plans to track improvements/bug fixes from the java implementation and the c++ port.

Thanks for your time and work!

Sequential decoding from Camera

As far as I understand now its only possible to decode image by image.
That forces user to interact with application in some way (by clicking decode/capture) I think library must provide way to scan images sequentially and emit signals on Tag found.
Or its possible already and I missed something..?
Again qtquick2 example would be perfect!

module "QZXing" is not installed in qml @ pelagicore/meta-pelux

Hi,

I clone this library and it is working fine in QML on my qt creator. Now i am try to add this in my project but in that it is not always showing
QZXing.h no such file or directory !!

i already generate QR code in x86 QT
reference : module "QZXing" is not installed in qml at QT plateform

Can't compile QZXingLive example

Hi
Some time ago I successfully compile and run QZXingLive example. But I cant remember what it is needed to be done in order to do this. First thing what I need to do is fix this line in Utilities.java:

ArrayList<String> permissionsToRequest = new ArrayList<>();
Correct is:
ArrayList<String> permissionsToRequest = new ArrayList<String>();

What is strange to me is the necessity some Java code (personally I hate this language!).
But it helps only a little. And more serious bug incoming:

    [javac] C:\QTSRC\external\qzxing\examples\build-QZXingLive-Android_dla_armeabi_v7a_GCC_4_9_Qt_5_8_0-Debug\android-build\src\org\ftylitak\qzxing\Utilities.java:6: error: package android.support.v4.app does not exist
    [javac] import android.support.v4.app.ActivityCompat;
    [javac]                              ^
    [javac] C:\QTSRC\external\qzxing\examples\build-QZXingLive-Android_dla_armeabi_v7a_GCC_4_9_Qt_5_8_0-Debug\android-build\src\org\ftylitak\qzxing\Utilities.java:7: error: package android.support.v4.content does not exist
    [javac] import android.support.v4.content.ContextCompat;
    [javac]                                  ^
    [javac] C:\QTSRC\external\qzxing\examples\build-QZXingLive-Android_dla_armeabi_v7a_GCC_4_9_Qt_5_8_0-Debug\android-build\src\org\ftylitak\qzxing\Utilities.java:24: error: cannot find symbol
    [javac]             if (ContextCompat.checkSelfPermission(activity, permissions[i])
    [javac]                 ^
    [javac]   symbol:   variable ContextCompat
    [javac]   location: class Utilities
    [javac] C:\QTSRC\external\qzxing\examples\build-QZXingLive-Android_dla_armeabi_v7a_GCC_4_9_Qt_5_8_0-Debug\android-build\src\org\ftylitak\qzxing\Utilities.java:30: error: cannot find symbol
    [javac]             ActivityCompat.requestPermissions(activity,
    [javac]             ^
    [javac]   symbol:   variable ActivityCompat
    [javac]   location: class Utilities
    [javac] Note: Some input files use or override a deprecated API.
    [javac] Note: Recompile with -Xlint:deprecation for details.
    [javac] 4 errors

Why I want again compile this example? Because I want to check whether it hangs when capture rectangle is bigger than 0,5width and 0,5height of the mobile screen. When I set it bigger (say full screen size or 0,8width and 0,8height then my app hangs when capture screen runs (it runs correctly when it had 0,5width and 0,5height).

I need bigger capture rectangle, because for our need is essential to capture QZXing.DecoderFormat_CODE_128 codes. And with capture rectangle in size 0,5width and 0,5height of the screen it does not capture at all. So I think that resolution is too low. But bigger capture rectangle hangs my app (as I mention above).

I try to run QZXingLive example on Android 4.4.2 (Api 19). Maybe do you use feature some newer Api in this example?

clearing GL error: 0x502

Hi,

I'm trying to deploy this application on an Android tablet. The compilation works and the application starts and the camera is available on the tablet but I have an error message in the application output:
W GLConsumer: [SurfaceTexture-0-15512-0] bindTextureImage: clearing GL error: 0x502
Also, I can't read any QR code.
Do you have any idea about what is wrong?

Thank you.

Using QZxingFilter with Qt C++ and not QML

I have an application written in c++ and not in qml. I am trying to use incorporate the QZingLive Example code or QZingFilter in this application...
I did not find a direct way to invoke the QZingFilter in c++. Hence I am trying to call the qml file from c++.
Functionality is...
When I press a button on my Qt Widget application screen, the camera is started to scan a barcode. if the barcode is scanned, then the data scanned is returned to the c++ window and displayed in a label.
Now I am able to accomplish that using the QZing without filter. However I need to have decoding on the live feed which is with the qzingfilter.
This is the code of the qml file which works but with qzing.

import QtQuick 2.5
import QtQuick.Controls 2.0
import QtQuick.Dialogs 1.2
import QtMultimedia 5.5
import QZXing 2.3

Rectangle {
    id : cameraUI

    width: parent.width
    height: parent.height

    color: "black"
    state: "PhotoCapture"
    focus: true

    Camera
    {
        id:camera
        captureMode: Camera.CaptureStillImage
        imageProcessing.whiteBalanceMode: CameraImageProcessing.WhiteBalanceFlash

         exposure {
             exposureCompensation: -1.0
             exposureMode: Camera.ExposurePortrait
         }

         flash.mode: Camera.FlashRedEyeReduction
        focus {
            focusMode: CameraFocus.FocusContinuous
            focusPointMode: CameraFocus.FocusPointAuto
        }
        imageCapture {
            onImageCaptured: {
                imageToDecode.source = preview
                decoder.decodeImageQML(imageToDecode)
            }
        }
        digitalZoom: camera.maximumDigitalZoom
    }

    Image{
        id: imageToDecode
        visible: false
    }

    VideoOutput
    {
        id: videoOutput
        source: camera
        autoOrientation: true
        height: parent.height
        focus: true
        MouseArea {
            anchors.fill: parent
            onClicked: {
                camera.imageCapture.capture();
            }
        }

        Rectangle {
            id: captureZone
            color: "red"
            opacity: 0.2
            width: parent.width / 2
            height: parent.height / 2
            anchors.centerIn: parent
        }
    }

    ZoomControl {
        id : myzcont
        x : 0
        y : 0
        width : 100
        height: parent.height

        maximumZoom: Math.min(4.0, camera.maximumDigitalZoom)
        currentZoom: camera.digitalZoom
        onZoomTo: camera.setDigitalZoom(value)
        onCurrentZoomChanged: camera.setDigitalZoom(value)
    }


    QZXing{
        id: decoder
        enabledDecoders: QZXing.DecoderFormat_QR_CODE | QZXing.DecoderFormat_DATA_MATRIX | QZXing.DecoderFormat_Aztec | QZXing.DecoderFormat_CODABAR | QZXing.DecoderFormat_CODE_128 | QZXing.DecoderFormat_CODE_39 | QZXing.DecoderFormat_CODE_93 | QZXing.DecoderFormat_EAN_13 | QZXing.DecoderFormat_EAN_8 | QZXing.DecoderFormat_ITF | QZXing.DecoderFormat_MAXICODE | QZXing.DecoderFormat_PDF_417 | QZXing.DecoderFormat_RSS_14 | QZXing.DecoderFormat_RSS_EXPANDED | QZXing.DecoderFormat_UPC_A | QZXing.DecoderFormat_UPC_E | QZXing.DecoderFormat_UPC_EAN_EXTENSION
        onDecodingStarted: console.log("Decoding of image started...")
        onTagFound: {
            console.log("Barcode data: " + tag)
            PrevWindow.barcodestr(tag)
        }
        onDecodingFinished: {
            console.log("Decoding finished " + (succeeded==true ? "successfully" :    "unsuccessfully") )
        }
    }
    Keys.onReleased: {
        if (event.key === Qt.Key_Back) {
            console.log("Back button captured - wunderbar !")
            event.accepted = true;
            PrevWindow.barcodestr("")
        }
    }

}

Now if i substitute the QZing {} part with this... then I get an error : QZXingFilter is not a type on the word QZXingFilter when this qml file is being invoked on pressing of button.

    QZXingFilter
    {
        id: decoder
        decoder {
            enabledDecoders: QZXing.DecoderFormat_EAN_13 | QZXing.DecoderFormat_CODE_39 | QZXing.DecoderFormat_QR_CODE

        onTagFound: {
            console.log("Barcode data: " + tag)
            PrevWindow.barcodestr(tag)
        }

    Keys.onReleased: {
        if (event.key === Qt.Key_Back) {
            console.log("Back button captured - wunderbar !")
            event.accepted = true;
            PrevWindow.barcodestr("")
        }
    }

I am invoking this qml file with the following code from the Mainwindow.

    QQuickWidget *m_quickWidget = new QQuickWidget();
    m_quickWidget->setResizeMode(QQuickWidget::SizeRootObjectToView );
    m_quickWidget->setSource(source2);
    m_quickWidget->rootContext()->setContextProperty("PrevWindow",this);
    setCentralWidget(m_quickWidget);

Is this the right way of using the QZxingfilter and how to use the QZingFilter with c++ application?
@ftylitak Could you please help.

getTagRect not always returns a valid position for QrCodes

Not sure why, but when decoding QrCodes sometimes the tag position returned is outside image limits.

Is any coordinate translation required?

Take a look at the return coordinates of the tag on each image:

matrixWidth = 2592
matrixHeight = 1944
QrCode = "DC00000000000TER1V6U2A4144"

Image OK
P[0].X = 582
P[0].Y = 604

P[1].X = 582
P[1].Y = 959

P[2].X = 272
P[2].Y = 959

P[3].X = 320
P[3].Y = 674

imageok

Image NOK
P[0].X = 602
P[0].Y = 2018

P[1].X = 956
P[1].Y = 2015

P[2].X = 959
P[2].Y = 2320

P[3].X = 675
P[3].Y = 2276

imagenok

memory leak in DataMatrixDecodedBitStreamParser.cpp

The last line (brackets aside that is) of that file reads

delete bytes;

while it should be

delete [] bytes;

as the bytes variable was allocated (a few lines higher up) with the new [] operator:

char* bytes = new char[count];

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.