xiaobo9 / libinsane

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Libinsane

Libinsane is the library to access scanners on both Linux and Windows.

Its main features are:

  • Cross-platform: tested on Linux and Windows, by CI and by users.
  • Cross-API: supports Sane (Linux), WIA2 (Windows) and TWAIN (Windows)
  • Cross-scanners: takes care of all the quirks of all the platforms and all the scanners to provide a consistent behaviour everywhere.
  • Cross-programming languages: Libinsane-GObject provides bindings for many programming languages (Python, Java, Ruby, etc) thanks to GObject Introspection.
  • Returns the scan as it goes: whenever possible, the image returned by the scanner is returned to the application as the scan goes.
  • Very few runtime dependencies: Libinsane itself is a pure C library with the strict minimum of runtime dependencies. Only Libinsane-Gobject depends on the GLib.

However it has some limitations:

  • It is only designed to work with scanners, not webcams, not USB keys, etc (think paper-eaters only)
  • TWAIN API or drivers may display some dialogs. Libinsane cannot prevent them.
  • Full page scan only: Presence of the options to set the scan area and their consistency cannot be guaranteed. You are advised to crop the image later in your own application (see Paperwork for example).
  • On Windows (both with WIA2 or TWAIN), images are often rotated by 180°. This is because both APIs return the scan as a BMP (DIB), and by default, BMPs start by the bottom of the image. Libinsane returns the top of the image first (as Sane does). Since we want applications to be able to display the scan as it goes, Libinsane has to rotate the image.
  • We do our best to support as many scanners and drivers as possible. However not all the scanners in the world are supported (nor even supportable). You can have a look at the Scanner database to see the scanners that are known to work and those that don't.

It is the successor of Pyinsane2 but shares no code with it.

It is released under LGPL v3+.

Related third-party projects:

  • lisgo: Go bindings for Libinsane

About

License:GNU Lesser General Public License v3.0


Languages

Language:C 96.5%Language:Python 2.0%Language:Meson 1.1%Language:Makefile 0.3%Language:Shell 0.1%Language:CSS 0.0%