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
  • Wrong Aztec-Code Generation in 3.5.1 compared to 3.4.1

    Wrong Aztec-Code Generation in 3.5.1 compared to 3.4.1

    I create an Aztec code with the content "abc" and have the encoding hints set to AZTEC_LAYERS=5, ERROR_CORRECTION=33, CHARACTER_SET=UTF8 . In the release 3.4.1 everything is ok, I can use a Scanner-App and get the expected result "abc". In the release 3.5.1 the generated BitmapMatrix and therefore the Aztec code looks different. When I scan it with the same scanner I get the result "HCM QN". Here is the method call:

    AztecWriter().encode(
            "abc",
            BarcodeFormat.AZTEC,
            width,
            height,
            hints"
    

    I am using the code/library in an Android app with Java.

    Did something change in the default settings? Do you have similar observations?

    version341 version351

    opened by danWon12 4
  • 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
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
I was fed up with writing Java classes to mirror json models. So I wrote this Java app to automate the process.

Json2Java I was fed up with writing Java classes to mirror json models. So I wrote this Java app to automate the process. What this tool can do right

Jon F Hancock 303 Oct 8, 2022
Simple Artificial Neural Network java library

SANN Simple Artificial Neural Network java library WIP Creating neural network Variant 1 //create new net (input, hidden, default len, output) Net net

Korpusov Maxim 14 Oct 11, 2022
AndroidPermissions 4.2 0.0 Java Android M was added to check Permission. but Permission check processing is so dirty.

Android Permissions Checker Android M was added to check Permission. but Permission check processing is so dirty. This Project is to be simple, Checki

Steve SeongUg Jung 340 Nov 11, 2022
Google core libraries for Java

Guava: Google Core Libraries for Java Guava is a set of core Java libraries from Google that includes new collection types (such as multimap and multi

Google 46.5k Jan 1, 2023
A Java client for the Sixpack A/B testing framework https://github.com/seatgeek/sixpack

sixpack-java A Java client for SeatGeek's Sixpack a/b testing framework: https://github.com/seatgeek/sixpack Installing Sixpack-java is currently only

null 135 Oct 7, 2022
Starter-Android-Library - Starter Android Library is an Android Project with Modular Architecture.

Starter-Android-Library - Starter Android Library is an Android Project with Modular Architecture.

OpenBytes 1 Feb 18, 2022
****. Use the native and support library variants instead - https://developer.android.com/guide/topics/ui/look-and-feel/fonts-in-xml.html. An android library that makes it easy to add custom fonts to edittexts and textviews

Add to your project Add this line to your dependencies in build.gradle compile 'in.workarounds.typography:typography:0.0.8' Using the views There are

Workarounds 43 Nov 6, 2021
An android library for displaying fps from the choreographer and percentage of time with two or more frames dropped

DEPRECATED TinyDancer is deprecated. No more development will be taking place. Check out the Google Android developer documentation for UI performance

Friendly Robot 1.9k Jan 3, 2023
Android Library to help you with your runtime Permissions.

PermissionHelper Android Library to help you with your runtime Permissions. Demo Android M Watch it in action. Pre M Watch it in action. Nexus 6 (M) N

Kosh Sergani 1.2k Dec 14, 2022
Android validation library which helps developer boil down the tedious work to three easy steps.

AwesomeValidation Introduction Implement validation for Android within only 3 steps. Developers should focus on their awesome code, and let the librar

Jing Li 1.1k Dec 17, 2022
A plug and play ;) android library for displaying a "rate this app" dialog

Easy Rating Dialog This lib provides a simple way to display an alert dialog for rating app. Default conditions to show: User opened the app more than

Fernando Martínez 111 Dec 30, 2022
Android library that manages your app's cached data with ease.

Teller Android library that makes your apps faster. Teller facilitates the downloading, saving, and reading of the cached data of your app. Keep your

Levi Bostian 14 Apr 2, 2022
Tutorial For openJDK 11 and AGP 7.0.0+ | Tutorial Multi Library Android in 1 Project | Groovy

jitpack-library-guide For openJDK 11 and AGP 7.0.0 + Please read every single note for detail Tutorial Click Here Kotlin DSL Click Here Repository for

Faisal Amir 7 Dec 10, 2022
AboutLibraries is a library to offer some information of libraries.

AboutLibraries .. allows you to easily create an used open source libraries fragment/activity within your app. All the library information is automati

Mike Penz 3.1k Jan 3, 2023
Makes Google play in app purchase library (BillingClient) into a flowable that can easily be used in compose world

Billy the android Our goal is to make a modern api of BillingClient so that it is easier to use in compose world. This library is still early beta and

Stefan Wärting 16 Dec 14, 2022
Using Resilience4J, this is a Demo project which uses a Library as background and manages all its requests.

Using Resilience4J, this is a Demo project which uses a Library as background and manages all its requests. This library can rent books online and the usage rate is extremely high. There is a reactive way to access, which is the one normally used, but sometimes, the system needs a bit of help from an old machine running a non-reactive MVC Spring application using JPA. Let's make this in Kotlin and find the best solution!

João Filipe Sabino Esperancinha 2 Jan 10, 2022
A library to display pokemon with Shakespearean descriptions

Pokemon Shakespeare SDK A library to display pokemon with Shakespearean descriptions Dependencies Java 11 Retrofit Picasso Material Appcompat Usage Cr

Keenen Charles 0 Nov 12, 2021
ArduinoJava - A project that uses the JSSC library

ArduinoJava este es un proyecto que utiliza la libreria JSSC para connectarse al

null 0 Jan 24, 2022
Editframe Kotlin Client library

Editframe Kotlin Client library Installing Add the project to your gradle dependencies.

editframe 2 Apr 7, 2022