Recent

Author Topic: ZXing  (Read 10399 times)

DonAlfredo

  • Hero Member
  • *****
  • Posts: 1505
ZXing
« on: June 30, 2018, 11:18:07 am »
Just to inform you.
I have ported the ZXing library towards FPC and Lazarus.

https://github.com/LongDirtyAnimAlf/ZXing.Delphi

Included are working demo's for Windows and Lazarus.
https://github.com/LongDirtyAnimAlf/ZXing.Delphi/tree/v_3.0/Lazarus

Please note.
This library makes extended use of generics.
ZXing library and demo's have been tested with FPC trunk and Lazarus trunk only.

af0815

  • Hero Member
  • *****
  • Posts: 771
Re: ZXing
« Reply #1 on: June 30, 2018, 02:39:54 pm »
Thx to DonAlfredo for his work.

I have done a try one year ago, but it was not successfull. So i know how much work it is, and how tricky some generic routines are programmed.
regards
Andreas

DonAlfredo

  • Hero Member
  • *****
  • Posts: 1505
Re: ZXing
« Reply #2 on: June 30, 2018, 03:02:36 pm »
You are welcome !

Porting was not that hard: the new Delphi compatible Generics made life much easier than before. Besides, the new source is still Delphi compatible !

I use this ZXing port for desktops together with an Android app that also scans qr-codes with the help of the native Java ZXing library.

All done with FPC and Lazarus and LAMW and Generics !!!

af0815

  • Hero Member
  • *****
  • Posts: 771
Re: ZXing
« Reply #3 on: June 30, 2018, 03:36:55 pm »
I have seen you work with v4l2. Some Cameras are only working with gstreamer.

Have you experience with gstreamer too ? I have not found any ported header, nor a project in Lazarus/Freepascal using this library for video and shooting still pictures.

 
regards
Andreas

Xor-el

  • Sr. Member
  • ****
  • Posts: 404
Re: ZXing
« Reply #4 on: June 30, 2018, 03:47:49 pm »
Just to inform you.
I have ported the ZXing library towards FPC and Lazarus.

https://github.com/LongDirtyAnimAlf/ZXing.Delphi

Included are working demo's for Windows and Lazarus.
https://github.com/LongDirtyAnimAlf/ZXing.Delphi/tree/v_3.0/Lazarus

Please note.
This library makes extended use of generics.
ZXing library and demo's have been tested with FPC trunk and Lazarus trunk only.

Edit:
Binaries for testing: https://github.com/LongDirtyAnimAlf/ZXing.Delphi/releases/tag/v3.5a

splendid, that's all I can say.
Good Job.
One Less Library to make FPC Compatible.  :D

Quick Question.
Is it possible for you to submit your changes as a pull request to the original repository.
it will make it less work to keep them in sync when the original repository makes an update.

Once again, well done and thanks.

DonAlfredo

  • Hero Member
  • *****
  • Posts: 1505
Re: ZXing
« Reply #5 on: July 03, 2018, 01:41:57 pm »
Small update.

Done: unit tests have been added.
Todo: solve some memory leaks.

Quote
Is it possible for you to submit your changes as a pull request to the original repository.

If I am ready with my work on this library, I will ask the original author.
However, I think changes are dim, due to the many changes.
Delphi compatibility is still maintained, so that will not be a show-stopper.

Quote
Have you experience with gstreamer too ?

No, I don't. Due to my limited time, I have to restricts my efforts to my current use of this lib.

DonAlfredo

  • Hero Member
  • *****
  • Posts: 1505
Re: ZXing
« Reply #6 on: July 07, 2018, 01:58:08 pm »
The work has been done.
ZXing has been ported 100%.
Consumed more effort due to memory-leaks: source had to be de-"ARC"-ed (ARC=auto-ref-count).

Two simple demo binaries (for Windows) are available:
https://github.com/LongDirtyAnimAlf/ZXing.Delphi/releases/latest

I have asked the author to have the two projects merged.

avra

  • Hero Member
  • *****
  • Posts: 2261
    • Additional info
Re: ZXing
« Reply #7 on: February 25, 2019, 10:51:41 am »
I have asked the author to have the two projects merged.
Were they merged? What would be the recommended repo now?

Btw, it would be more convenient if there was a LPK file.
« Last Edit: February 25, 2019, 10:55:16 am by avra »
ct2laz - Conversion between Lazarus and CodeTyphon
bithelpers - Bit manipulation for standard types
pasettimino - Siemens S7 PLC lib

Jurassic Pork

  • Hero Member
  • *****
  • Posts: 1063
Re: ZXing
« Reply #8 on: March 20, 2021, 01:54:30 am »
hello DonAlfredo,
thanks for your work !
i have this problem to compile your zxing lazarus library : generic TList not working with Enumerated type with constant assignment.
Windows 10 Lazarus 2.0.12 fpc 3.2
Can you check that ?
Friendly, J.P
« Last Edit: March 20, 2021, 01:56:51 am by Jurassic Pork »
Jurassic computer : Sinclair ZX81 - Zilog Z80A à 3,25 MHz - RAM 1 Ko - ROM 8 Ko

trev

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1679
  • Former Delphi 1-7, 10.2 user
Re: ZXing
« Reply #9 on: March 20, 2021, 04:45:49 am »
As DonAlfredo notes "ZXing library and demo's have been tested with FPC trunk and Lazarus trunk only", I'd suspect you need to use FPC + Lazarus trunk.
Lazarus 2.3, FPC 3.3.1 macOS 12.0.1 x86_64 Xcode 13.1
Lazarus 2.3, FPC 3.3.1 macOS 12.0.1 aarch64 Xcode 13.1
Lazarus 2.3, FPC 3.2.2 FreeBSD 13.0 amd64 VM
Lazarus 2.3, FPC 3.2.2 FreeBSD 12.2 amd64 VM
Lazarus 2.1 r61574 FPC 3.0.4 Ubuntu 20.04 VM
Lazarus 2.0.10 FPC 3.2.0 Win10 VM

DonAlfredo

  • Hero Member
  • *****
  • Posts: 1505
Re: ZXing
« Reply #10 on: March 20, 2021, 08:33:35 am »
@Jurassic Pork
This is a known problem. And easy to solve. Just compile again !
Yes, your read this correct: you need to compile the sources twice.
Seems to be a compiler problem, but I never took the time to look into it more closely.

Jurassic Pork

  • Hero Member
  • *****
  • Posts: 1063
Re: ZXing
« Reply #11 on: March 20, 2021, 09:38:41 am »
hello,
ok Thanks DonAlfredo it works !    :)
Friendly J.P
Jurassic computer : Sinclair ZX81 - Zilog Z80A à 3,25 MHz - RAM 1 Ko - ROM 8 Ko

DonAlfredo

  • Hero Member
  • *****
  • Posts: 1505
Re: ZXing
« Reply #12 on: March 20, 2021, 10:20:54 am »
As you were able to isolate this problem (many thanks for that), I think its worth to file a bugger and have some FPC devs look at it.
I have filed it: https://bugs.freepascal.org/view.php?id=38642

Grahame Grieve

  • Full Member
  • ***
  • Posts: 207
Re: ZXing
« Reply #13 on: October 05, 2021, 09:28:13 pm »
thnks @DonAlfredo, this is good stuff. But unfortunately, while it compiles with the latest trunk, the linker fails:

fhirtoolkit.lpr(51,1) Error: Undefined symbol: RTTI_$ZXING.RESULTPOINT_$$_TARRAY$1$CRCE4D18BA0 (first seen in ZXing.OneD.OneDReader.o)
fhirtoolkit.lpr(51,1) Error: Undefined symbol: ZXING.READRESULT$_$TREADRESULT_$__$$_CREATE$crc38BEB87B (first seen in ZXing.OneD.Code128Reader.o)
fhirtoolkit.lpr(51,1) Error: Undefined symbol: RTTI_$ZXING.RESULTPOINT_$$_TARRAY$1$CRCE4D18BA0$indirect (first seen in ZXing.QrCode.QRCodeReader.o)
fhirtoolkit.lpr(51,1) Error: Undefined symbol: ZXING.READRESULT$_$TREADRESULT_$__$$_ADDRESULTPOINTS$TARRAY$1$CRCE4D18BA0 (first seen in ZXing.OneD.UPCEANReader.o)
fhirtoolkit.lpr(51,1) Error: Undefined symbol: ZXING.READRESULT$_$TCUSTOMDICTIONARY$3$CRC8D1CED1D_$__$$_SETVALUE$IMETADATA$IMETADATA (first seen in ZXing.OneD.UPCEANExtension2Support.o)

Does anyone know anything about this?

Grahame Grieve

  • Full Member
  • ***
  • Posts: 207
Re: ZXing
« Reply #14 on: October 24, 2021, 11:01:29 pm »
I don't know why, or if I did something different I don't know about, but this is no longer a problem for me

 

TinyPortal © 2005-2018