# Using zbar library with FileMaker

**URL:** <https://the.fmsoup.org/t/using-zbar-library-with-filemaker/2238>\
**Category:** MBS Plugins\
**Tags:** scripting\
**Created:** [June 22, 2021, 7:44am UTC](https://the.fmsoup.org/t/using-zbar-library-with-filemaker/2238 "2021-06-22T07:44:37Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![MonkeybreadSoftware](https://yyz2.discourse-cdn.com/flex030/user_avatar/the.fmsoup.org/monkeybreadsoftware/32/361_2.png) [@MonkeybreadSoftware](https://the.fmsoup.org/u/MonkeybreadSoftware)\
**Post date:** [June 22, 2021, 7:44am UTC](https://the.fmsoup.org/t/using-zbar-library-with-filemaker/2238/1 "2021-06-22T07:44:38Z")

</div>

You may know that our [MBS FileMaker Plugin](https://www.monkeybreadsoftware.com/filemaker/) has functions for barcode generation and recognition. The [Barcode.Detect](https://www.mbsplugins.eu/BarcodeDetect.shtml) function is based on the open source zxing library can recognize various types, but sadly not all QRCodes recently.

To solve this we add support for the zbar open source library with our new [Barcode.Scan](https://www.mbsplugins.eu/BarcodeScan.shtml) function. Since the library is GPL, you have to include the library file with the application and load it at runtime with [Barcode.LoadLibrary](https://www.mbsplugins.eu/BarcodeLoadLibrary.shtml) function. You may get a zbar library from the project website or from our [Libs folder in download section](https://www.monkeybreadsoftware.com/filemaker/files/Libs/). Our example project shows how to load the library at startup of application. On Linux you may just be able to install libzbar0 package and get libzbar installed.

![](https://www.mbs-plugins.com/image/zbarFileMaker.jpg)

When you like to scan a barcode, get a picture for the barcode. Make sure contrast is good and your barcodes are fully visible with a bit of border space around. Since scanning is done in black and white, you can preprocess the image to increase visibility with auto leveling, e.g. [GMImage.Level](https://www.mbsplugins.eu/GMImageLevel.shtml) function. You call Scan() function and pass the picture and you receive a JSON array with barcodes found. You may get multiple result with different quality values, so you may pick the highest one. Sometimes a few lines or some text is recognized as a barcode. To increase reliability you may limit the list of barcodes types you like to have and thus ignore all others.

Supported types includes EAN-13/UPC-A, UPC-E, EAN-8, Code 128, Code 39, Interleaved 2 of 5 and QR Code.

Our tests show that zbar can recognize a few barcodes, which didn't work with [Barcode.Detect](https://www.mbsplugins.eu/BarcodeDetect.shtml). But since we also found EAN and UPC barcodes recognized in zxing, but not in zbar. Well, you may eventually use both to see what recognizes what.

Please ty with 11.3pr3 or later and please don't hesitate to contact us with your questions.

For macOS and iOS see also [Vision.DetectBarcode](https://www.mbsplugins.eu/VisionDetectBarcode.shtml) and [Vision.SupportedSymbologies](https://www.mbsplugins.eu/VisionSupportedSymbologies.shtml) functions to use Apple's Vision framework.

---

<div class="post-metadata">

**Author:** ![MonkeybreadSoftware](https://yyz2.discourse-cdn.com/flex030/user_avatar/the.fmsoup.org/monkeybreadsoftware/32/361_2.png) [@MonkeybreadSoftware](https://the.fmsoup.org/u/MonkeybreadSoftware)\
**Post date:** [July 14, 2021, 6:26am UTC](https://the.fmsoup.org/t/using-zbar-library-with-filemaker/2238/2 "2021-07-14T06:26:57Z")

</div>

Now available in [MBS FileMaker Plugin 11.3](https://www.mbs-plugins.com/archive/2021-07-12/MBS_FileMaker_Plugin_113_-_Mor/monkeybreadsoftware_blog_filemaker)
