ZXing ("Zebra Crossing") barcode scanning library for Java, Android

Overview

Project in Maintenance Mode Only

The project is in maintenance mode, meaning, changes are driven by contributed patches. Only bug fixes and minor enhancements will be considered. The Barcode Scanner app can no longer be published, so it's unlikely any changes will be accepted for it. There is otherwise no active development or roadmap for this project. It is "DIY".

Get Started Developing

To get started, please visit: https://github.com/zxing/zxing/wiki/Getting-Started-Developing

ZXing ("zebra crossing") is an open-source, multi-format 1D/2D barcode image processing library implemented in Java, with ports to other languages.

Supported Formats

1D product 1D industrial 2D
UPC-A Code 39 QR Code
UPC-E Code 93 Data Matrix
EAN-8 Code 128 Aztec
EAN-13 Codabar PDF 417
UPC/EAN Extension 2/5 ITF MaxiCode
RSS-14
RSS-Expanded

Components

Active

Module Description
core The core image decoding library, and test code
javase JavaSE-specific client code
android Android client Barcode Scanner
android-integration Supports integration with Barcode Scanner via Intent
android-core Android-related code shared among android, other Android apps
zxingorg The source behind zxing.org
zxing.appspot.com The source behind web-based barcode generator at zxing.appspot.com

Available in previous releases

Module Description
cpp C++ port
iphone iPhone client
objc Objective C port
actionscript Partial ActionScript port
jruby JRuby wrapper

ZXing-based third-party open source projects

Module Description
QZXing port to Qt framework
glassechidna/zxing-cpp port to C++ (forked from the deprecated official C++ port)
nu-book/zxing-cpp recent port to C++
zxing_cpp.rb bindings for Ruby (not just JRuby), powered by zxing-cpp
jsqrcode port to JavaScript
python-zxing bindings for Python
ZXing .NET port to .NET and C#, and related Windows platform
php-qrcode-detector-decoder port to PHP
ZXing Delphi Port to native Delphi object pascal, targeted at Firemonkey compatible devices (IOS/Android/Win/OSX) and VCL.
ZXingObjC Port to Objective-C
php-zxing PHP wrapper to Zxing Java library
zxing-js/library TypeScript port of ZXing library
pyzxing Python wrapper to ZXing library

Other related third-party open source projects

Module Description
Barcode4J Generator library in Java
ZBar Reader library in C99
OkapiBarcode

Links

Contacting

Post to the discussion forum or tag a question with zxing on StackOverflow.

Etcetera

Build Status Coverity Status codecov.io Codacy Badge

QR code is trademarked by Denso Wave, inc. Thanks to Haase & Martin OHG for contributing the logo.

Optimized with JProfiler

Comments
  • Add decoding hint DecodeHintType.QR_ASSUME_SPEC_CONFORM_INPUT

    Add decoding hint DecodeHintType.QR_ASSUME_SPEC_CONFORM_INPUT

    Important: This also changes the default decoding behavior of the qr-code decoder for the case that KANJI mode data is encountered which is preceded by an ECI with a value different than 20 (Shift-JIS). In this case the data in interpreted in the encoding of the ECI and not as Shift-JIS.

    opened by AlexGeller1 31
  • Java Exception: java.lang.IllegalStateException: Failed to recover - encoded with PDF_417 in 110x166

    Java Exception: java.lang.IllegalStateException: Failed to recover - encoded with PDF_417 in 110x166

    Hi .

    Using jazzer, the following exception has been occurred :

    Java Exception: java.lang.IllegalStateException: Failed to recover .

    The produced jazzer file is as :

    
    import java.lang.reflect.InvocationTargetException;
    import java.lang.reflect.Method;
    public class Crash_554492f3abaea0e383717bff996d44d0cdb12f5f {
        static final String base64Bytes = "rO0ABXNyABNqYXZhLnV0aWwuQXJyYXlMaXN0eIHSHZnHYZ0DAAFJAARzaXpleHAAAAADdwQAAAADc3IAEWphdmEubGFuZy5JbnRlZ2VyEuKgpPeBhzgCAAFJAAV2YWx1ZXhyABBqYXZhLmxhbmcuTnVtYmVyhqyVHQuU4IsCAAB4cAAAAG5zcQB+AAIAAACAdAAAeA==";
    
        public static void main(String[] args) {
            ClassLoader.getSystemClassLoader().setDefaultAssertionStatus(true);
            try {
                Method fuzzerInitialize = MultiFormatEncodeFuzzer.class.getMethod("fuzzerInitialize");
                fuzzerInitialize.invoke(null);
            } catch (NoSuchMethodException ignored) {
                try {
                    Method fuzzerInitialize = MultiFormatEncodeFuzzer.class.getMethod("fuzzerInitialize", String[].class);
                    fuzzerInitialize.invoke(null, (Object) args);
                } catch (NoSuchMethodException ignored) {
                } catch (IllegalAccessException | InvocationTargetException e) {
                    e.printStackTrace();
                    System.exit(1);
                }
            } catch (IllegalAccessException | InvocationTargetException e) {
                e.printStackTrace();
                System.exit(1);
            }
            com.code_intelligence.jazzer.api.CannedFuzzedDataProvider input = new com.code_intelligence.jazzer.api.CannedFuzzedDataProvider(base64Bytes);
            MultiFormatEncodeFuzzer.fuzzerTestOneInput(input);
        }
    }
    
    
    

    And the corpus required to reproduce (Please first unzip it) :

    crash-corpus.zip

    To reproduce :

    ./MultiFormatEncodeFuzzer [crashing-corpus] Thanks!

    bug 
    opened by Microsvuln 19
  • Corner-case bug in Reed Solomon code?

    Corner-case bug in Reed Solomon code?

    Hi,

    First, thanks for this great library. I'm just using the Reed Solomon part of it and I stumbled on I think a corner-case bug.

    When using data+error_codes of size 256, if I corrupt the first byte (after ReedSolomon encoding), neither the byte is "repaired" nor an exception is thrown when decoding. It doesn't seem to matter how many error_codes I use or the data content, but it only fails for data+error_codes of size 256.

    I grep'd the ReedSolomon code for literals 255 and 256 but saw nothing fishy.

    Hmm, code formatter on this wiki not working for me. JUnit test below. Depends on RSEncoderDecoder class, which looks fine by inspection (attached as '.txt') RSEncoderDecoder.txt

    import java.util.Arrays; import org.junit.Test; import com.casualcoding.reedsolomon.RSEncoderDecoder; public class ReedSolomonByte0Bug { @Test public void testRSStreamAllZeros() throws Exception { /* * numEcBytes doesn't seem to matter */ int numEcBytes = 8;

        for (int totalBlockSizeBytes = 10; totalBlockSizeBytes <= 256; totalBlockSizeBytes++)
        {
    
            byte[] mesg = new byte[totalBlockSizeBytes - numEcBytes];
    
            for (int i = 0; i < mesg.length; i++)
            {
                mesg[i] = (byte) i;
            }
    
            RSEncoderDecoder rs = new RSEncoderDecoder();
            byte[] rsmesg = rs.encodeData(mesg, numEcBytes);
    
            /*
             * Corrupt byte 0.  Corrupting other bytes works correctly
             */
            rsmesg[0] = (byte) (rsmesg[0] + 1);
    
            // No exception thrown ...
            byte[] testDecode = rs.decodeData(rsmesg, numEcBytes);
    
            /*
             * Fails for totalBlockSize = 256
             */
            if (Arrays.equals(mesg, testDecode) == false)
            {
                System.out.println("Failed: totalBlockSizeBytes = " + totalBlockSizeBytes);
            }
        }
    }
    

    }

    bug 
    opened by nasamaher 2
  • CommandLineEncoder appears to ignore the height and width parameters when barcode_format is  DATA_MATRIX

    CommandLineEncoder appears to ignore the height and width parameters when barcode_format is DATA_MATRIX

    CommandLineEncoder appears to ignore the height and width parameters when barcode_format is DATA_MATRIX

    The following command produces a 14px by 14px image instead of a 500px by 500px image:

    java -cp javase/target/javase-3.3.0-jar-with-dependencies.jar com.google.zxing.client.j2se.CommandLineEncoder --barcode_format DATA_MATRIX --height 500 --width 500 abcdefg
    

    Here's a Dockerfile to reproduce this issue:

    FROM ubuntu:16.04
    RUN apt-get update && apt-get install -y --no-install-recommends default-jdk git maven
    RUN git clone --depth 1 --branch zxing-3.3.0 https://github.com/zxing/zxing.git
    RUN cd zxing && mvn install -DskipTests
    RUN cd zxing/javase && mvn -DskipTests package assembly:single
    RUN cd zxing && java -cp javase/target/javase-3.3.0-jar-with-dependencies.jar com.google.zxing.client.j2se.CommandLineEncoder --barcode_format DATA_MATRIX --height 500 --width 500 abcdefg
    

    Is this a bug or am I using CommandLineEncoder wrong?

    enhancement 
    opened by ablegreen 4
  • Barcode Scanner: Decoding of multiple iCal/ics whole-day VEVENTs fails for second and further events

    Barcode Scanner: Decoding of multiple iCal/ics whole-day VEVENTs fails for second and further events

    Hello, I generated a QR code from the following whole-data-events in ics format.

    Bug

    • The current Zxing Barcode Scanner on Android detects only the first event (20151012)
    • but fails to detect/decode the further events.
    BEGIN:VCALENDAR
    PRODID:Leave Planner Version 201512041000
    COMMENT:5 day/s exported on 20151204
    VERSION:2.0
    BEGIN:VEVENT
    SUMMARY:XLEAVE
    DTSTART;VALUE=DATE:20151012
    END:VEVENT
    BEGIN:VEVENT
    SUMMARY:XLEAVE
    DTSTART;VALUE=DATE:20151013
    END:VEVENT
    BEGIN:VEVENT
    SUMMARY:XLEAVE
    DTSTART;VALUE=DATE:20151014
    END:VEVENT
    BEGIN:VEVENT
    SUMMARY:XLEAVE
    DTSTART;VALUE=DATE:20151015
    END:VEVENT
    BEGIN:VEVENT
    SUMMARY:XLEAVE
    DTSTART;VALUE=DATE:20151016
    END:VEVENT
    END:VCALENDAR
    

    here's the code to generate with your online web side:

    https://zxing.org/w/chart?cht=qr&chs=350x350&chld=L&choe=UTF-8&chl=BEGIN%3AVCALENDAR%0APRODID%3ALeave+Planner+Version+201512041000%0ACOMMENT%3A5+day%2Fs+exported+on+20151204%0AVERSION%3A2.0%0ABEGIN%3AVEVENT%0ASUMMARY%3AXLEAVE%0ADTSTART%3BVALUE%3DDATE%3A20151012%0AEND%3AVEVENT%0ABEGIN%3AVEVENT%0ASUMMARY%3AXLEAVE%0ADTSTART%3BVALUE%3DDATE%3A20151013%0AEND%3AVEVENT%0ABEGIN%3AVEVENT%0ASUMMARY%3AXLEAVE%0ADTSTART%3BVALUE%3DDATE%3A20151014%0AEND%3AVEVENT%0ABEGIN%3AVEVENT%0ASUMMARY%3AXLEAVE%0ADTSTART%3BVALUE%3DDATE%3A20151015%0AEND%3AVEVENT%0ABEGIN%3AVEVENT%0ASUMMARY%3AXLEAVE%0ADTSTART%3BVALUE%3DDATE%3A20151016%0AEND%3AVEVENT%0AEND%3AVCALENDAR%0A

    enhancement 
    opened by Wikinaut 5
  • MECARD / vCard encoding should delimit fields

    MECARD / vCard encoding should delimit fields

    Address / city / state / postal code and so on are supposed to be separated in MECARD and vCard, by comma and semicolon, respectively. The code right now doesn't break this down beyond an address field though, so isn't able to format accordingly.

    Ideally the online encoder would have separate fields for address components. And, in Android, would retrieve address elements independently. However I am not sure Android breaks this out either, not via Intent.

    Ported from https://code.google.com/p/zxing/issues/detail?id=1468

    bug 
    opened by srowen 2
Releases(zxing-3.5.1)
Owner
ZXing Project
ZXing is an open-source, multi-format 1D/2D barcode image processing library implemented in Java, with ports to other languages.
ZXing Project
Pw0 Framewrok - magical android pentest app 🔮! Pixie Dust, Handshakes, Deauth, Nmap, Port scanner and more!

Pw0 Framework Pw0 Framewrok - magical android pentest app ?? ! Features: Pixie Dust Handshakes Deauth Nmap Port scanner and more! Version: 0.2 Beta Au

Huntmix 17 Sep 27, 2021
A well-designed local image and video selector for Android

Matisse Matisse is a well-designed local image and video selector for Android. You can Use it in Activity or Fragment Select images including JPEG, PN

Zhihu 12.4k Dec 8, 2022
Simple Java image-scaling library implementing Chris Campbell's incremental scaling algorithm as well as Java2D's "best-practices" image-scaling techniques.

imgscalr - Java Image-Scaling Library http://www.thebuzzmedia.com/software/imgscalr-java-image-scaling-library/ Changelog --------- 4.2 * Added sup

Riyad Kalla 1.1k Dec 3, 2022
Thumbnailator - a thumbnail generation library for Java

March 11, 2021: Thumbnailator 0.4.14 has been released! See Changes for details. Thumbnailator is now available through Maven! What is Thumbnailator?

Chris Kroells 4.4k Dec 3, 2022
Roman Beskrovnyi 245 Nov 18, 2022
Java library for remapper JARs

Pocolifo's JAR Remapper Making remapping JARs easy, organized, and painless Features Remapping Class remapping Method remapping Field remapping Parame

null 8 Oct 2, 2022
A Java Visualization Library based on Apache ECharts.

ECharts Java "We bring better visualization into Java with ECharts" ?? Introduction ECharts Java is a lightweight but comprehensive library for Java d

ECharts Java Open Source Project 154 Nov 28, 2022
Fast computer vision library for SFM, calibration, fiducials, tracking, image processing, and more.

Table of Contents Introduction Cloning Repository Quick Start Gradle and Maven Building from Source Dependencies Help/Contact Introduction BoofCV is a

Peter Abeles 909 Dec 6, 2022
Java interface to OpenCV, FFmpeg, and more

JavaCV Commercial support: Introduction JavaCV uses wrappers from the JavaCPP Presets of commonly used libraries by researchers in the field of comput

Bytedeco 6.3k Dec 2, 2022
Java JNA wrapper for Tesseract OCR API

Tess4J A Java JNA wrapper for Tesseract OCR API. Tess4J is released and distributed under the Apache License, v2.0. Features The library provides opti

Quan Nguyen 1.2k Nov 28, 2022
TwelveMonkeys ImageIO: Additional plug-ins and extensions for Java's ImageIO

About TwelveMonkeys ImageIO is a collection of plugins and extensions for Java's ImageIO. These plugins extend the number of image file formats suppor

Harald Kuhr 1.5k Dec 3, 2022
Creates ASCII art in Java from Images

Creates ASCII art in Java from Images. It can also save the ASCII art as image (.png) as well

Navjot Singh Rakhra 4 Jul 12, 2022
Netflix, Inc. 810 Dec 1, 2022
log4j2-scan is a single binary command-line tool for CVE-2021-44228 vulnerability scanning and mitigation patch

log4j2-scan is a single binary command-line tool for CVE-2021-44228 vulnerability scanning and mitigation patch. It also supports nested JAR file scan

Logpresso GitHub 839 Nov 23, 2022
Aye - an open source tool for scanning images on Kubernetes cluster

Aye is an open source tool for scanning images on Kubernetes cluster. It uses Anchore CLI behind the scenes to get information about all images that are currently on the cluster. It also provides Prometheus metrics for each image, so teams are aware of different levels of vulnerabilities found inside them.

null 4 Sep 4, 2022
The Google code scanner API provides a complete solution for scanning codes without requiring your app to request camera permission.

Android Google Code Scanner The Google code scanner API provides a complete solution for scanning codes without requiring your app to request camera p

Prabhakar Thota 7 Nov 23, 2022
Android Auto Apps Downloader (AAAD) is an app for Android Phones that downloads popular Android Auto 3rd party apps and installs them in the correct way to have them in Android Auto.

Android Auto Apps Downloader (AAAD) is an app for Android Phones that downloads popular Android Auto 3rd party apps and installs them in the correct way to have them in Android Auto.

Gabriele Rizzo 822 Nov 28, 2022
Tinker is a hot-fix solution library for Android, it supports dex, library and resources update without reinstall apk.

Tinker Tinker is a hot-fix solution library for Android, it supports dex, library and resources update without reinstalling apk. Getting started Add t

Tencent 16.6k Nov 26, 2022