Components | All | New | MacOS | Windows | Linux | iOS | ||||
Examples | Mac & Win | Server | Client | Guides | Statistic | FMM | Blog | Deprecated | Old |
Barcode.Detect
Detects a barcode.
Component | Version | macOS | Windows | Linux | Server | iOS SDK |
Barcode | 3.5 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |
MBS( "Barcode.Detect"; Image { ; type; ReturnType; TryRotation; Encoding } ) More
Parameters
Parameter | Description | Example | Flags |
---|---|---|---|
Image | The image to scan for a barcode. Can be container with image or an Image reference number from our GraphicsMagick image functions. |
$image | |
type | Which scanner to use. Supported types: Aztec, Codabar, Code39, Code93, Code128, DataMatrix, EAN8, EAN13, ITF, PDF417, QRCode, UPCA and UPCE. Pass All to scan for all types. Default is all. |
"QRCode" | Optional |
ReturnType | A boolean to return the type as prefix. Pass 1 if you need prefix. Default is 0 for no prefix. | 1 | Optional |
TryRotation | A boolean value. If 1, the plugin will rotate the image 90° to find vertical barcode. Default is true. |
1 | Optional |
Encoding | The text encoding for text parameter. Default is UTF-8. Possible encoding names: ANSI, ISO-8859-1, Latin1, Mac, Native, UTF-8, DOS, Hex, Base64 or Windows. More listed in the FAQ. |
UTF8 | Optional |
Result
Returns barcode content text or error.
Description
Detects a barcode.We use zxing library internally and can only detect what this library handles.
Internally all images are converted to grayscale. For you getting image, it's very important to get a sharp image.
You may need to rotate or crop the image before sending into this method.
Leave some white space around as some decoders don't want to start with black frame on the edge. The barcodes generated with Barcode.Generate often don't read as they have too little resolution (e.g. scale up by 3x) and no white border around (e.g. add 5 pixels).
If special characters or umlauts are not recognized correct, you may have a wrong encoding. Most modern apps use UTF8 for encoding.
For MacOS and iOS, you can also detect barcodes with CoreImage.Detect function, which is faster and can better find a barcode on a picture.
Please note that Barcode.Detect uses zxing library, which can't read all barcodes well. For that reason we got Barcode.Scan using zbar library, which may be better.
For FileMaker Go, please use PSoS and do the scan server side. Or build your own app based on the FileMaker iOS SDK with Xcode and embed the MBS Plugin for on device detection.
See also Barcode.DetectAsJSON to get more detailed output of the result.
Examples
Query a QRCode:
MBS( "Barcode.Detect"; Images::Image; "QRCode" )
See also
- AVRecorder.CaptureStillPhoto
- AVRecorder.StartQRCodeDetection
- Barcode.DetectAsJSON
- Barcode.Generate
- Barcode.Scan
- CoreImage.Detect
- Vision.DetectBarcode
Release notes
- Version 14.5
- Added Barcode.DetectAsJSON function.
- Improved Barcode.Detect by using newer zxing library.
- Version 12.2
- Deprecated Barcode.Detect in favor of Barcode.Scan function.
- Version 11.2
- Updated zxing library to get a few newer bug fixes for Barcode.Detect function.
- Version 8.2
- Changed Barcode.Detect to report the version number read when complaining about invalid version in QRCode.
- Fixed crash with Barcode.Detect with out of bounds access in image for bad QRCodes.
- Version 8.0
- Fixed out of bounds problem in Barcode.Detect. And now returns checksum errors properly.
Example Databases
- Barcode/Barcode Detection
- Barcode/Barcodes from Invoices
- Barcode/Swiss QR-Code for invoices/Swiss QR-Code for invoices ISO 20022
Blog Entries
- MBS FileMaker Plugin 14.5 for Claris FileMaker
- MBS FileMaker Plugin, version 14.5pr1
- Claris FileMaker 19.5 available
- Upcoming changes for MBS Plugins
- MBS FileMaker Plugin, version 12.2pr4
- MBS FileMaker Plugin 11.3 - More than 6500 Functions In One Plugin
- Using zbar library with FileMaker
- Combine MBS functions to automate processes in FileMaker
- Live barcode reading for FileMaker on MacOS and iOS
- MBS FileMaker Plugin 3.5 for OS X/Windows - More than 2100 Functions In One Plugin
FileMaker Magazin
This function checks for a license.
Created 18th August 2014, last changed 22nd September 2024