mchehab / zbar

ZBar is an open source software suite for reading bar codes from various sources, including webcams. As its development stopped in 2012, I took the task of keeping it updated with the V4L2 API. This is the main repository for it. There's a clone at at LinuxTV.org, and another one at gitlab.
https://linuxtv.org/downloads/zbar/
GNU Lesser General Public License v2.1
1k stars 206 forks source link

Updated the Python GTK widget to Python 3 and GTK 3. #221

Closed PieroV closed 2 years ago

PieroV commented 2 years ago

The previous implementation of the Python wrapper around the GTK widget was written for Python 2 and GTK 2.

Python 2 has been EOL for more than two years, but the widget is still very interesting.

Also, the way to integrate GTK and Python has changed a lot during the years.

So, the ZBarGtk widget type is registered automatically by gi, and the only needed step in the bindings is creating and returning the widget somehow.

I also implemented the request video size functionality through new attributes: video-width and video-height.

The only feature the Python wrapper is missing is the possibility to scan a GdkPixbuf, because I could not find a way to register a new method to the __gi__.ZBarGtk type without reimplementing it completely.

Please notice that I have sent this code to Tails, but it is missing the whole licensing comment. The reason is that, while git detects it as a series of changes on pygtk/zbargtkmodule.c, it actually is a complete rewritten from scratch. In any case, I am the author also of that code.

PieroV commented 2 years ago

Sorry, I did not notice the GIR section on the README. I guess that this can be closed, then.