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
Skrull is a malware DRM, that prevents Automatic Sample Submission by AV/EDR and Signature Scanning from Kernel.

Skrull is a malware DRM, that prevents Automatic Sample Submission by AV/EDR and Signature Scanning from Kernel. It generates launchers that can run malware on the victim using the Process Ghosting technique. Also, launchers are totally anti-copy and naturally broken when got submitted.

Sheng-Hao Ma 413 Dec 10, 2022
Lidar-with-velocity - Lidar with Velocity: Motion Distortion Correction of Point Clouds from Oscillating Scanning Lidars

Lidar with Velocity A robust camera and Lidar fusion based velocity estimator to undistort the pointcloud. This repository is a barebones implementati

ISEE Research Group 163 Dec 15, 2022
3D scanning is becoming more and more ubiquitous.

Welcome to the MeshLib! 3D scanning is becoming more and more ubiquitous. Robotic automation, self-driving cars and multitude of other industrial, med

null 121 Dec 31, 2022
First open source android modding library for Geometry Dash Based on Hooking-and-Patching-android-template

Android-ML First open source android modding library for Geometry Dash Based on Hooking-and-Patching-android-template Installation Download this githu

BlackTea ML 21 Jul 17, 2022
A simple library that helps Android developers to execute JavaScript code from Android native side easily without using Webview.

AndroidJSModule A simple library that helps Android developers to execute JavaScript code from Android native side easily without using Webview. Insta

Hung Nguyen 5 May 24, 2022
A customized LGL Android mod menu, containing ESP only for PUBG Mobile 1.3.0 for Android

PUBG Mobile ESP Mod Menu A customized LGL mod menu, containing ESP only for PUBG Mobile 1.3.0 for Android. Everything are fixed so it works with both

null 42 Mar 19, 2022
A repository for experimenting with elf loading and in-place patching of android native libraries on non-android operating systems.

droidports: A repository for experimenting with elf loading and in-place patching of android native libraries on non-android operating systems. Discla

João Henrique 26 Dec 15, 2022
Android NDK samples with Android Studio

NDK Samples This repository contains Android NDK samples with Android Studio C++ integration. These samples use the new CMake Android plugin with C++

Android 9.2k Dec 27, 2022
JWM is a cross-platform Java window management and OS integration library.

JWM aims to expose an interface that abstracts over window creation, input handling and OS integration

JetBrains 403 Jan 9, 2023
A simple C++ library with multi language interfaces (Java, NodeJS, Python...)

cpp-to-x A simple C++ library with multi language interfaces (Java, NodeJS, Python...) Why This is just a learning experiment to see how you can write

James Roberts 1 Nov 25, 2021
JWM - Cross-platform window management and OS integration library for Java

Java Window Management library Vision JWM is a cross-platform Java window management and OS integration library. JWM aims to expose an interface that

Humble UI 392 Dec 27, 2022
A perfect blend of C, Java, and Python tailored for those who desire a simple yet powerful programming language.

Fastcode A perfect blend of C, Java, and Python tailored for those who desire a simple yet powerful programming language. FastCode is a procedural/str

null 28 Aug 19, 2022
Get a users HWID in C++ and use it in Java

JNA Example rust version with jni soon What is this? This is example of using c++ and jna to get the hwid of a computer. Why? Your program will be mor

Jake Priddle 21 Sep 22, 2021
RR4J is a tool that records java execution and later allows developers to replay locally.

RR4J [Record Replay 4 Java] RR4J is a tool that records java execution and later allows developers to replay locally. The tool solves one of the chall

Kartik  kalaghatgi 18 Dec 7, 2022
Stock exchange simulator made in Swing using Java with logic backend in C++ giving it faster load time and better data control

StockSimulator Stock exchange simulator made in Swing using Java with logic backend in C++ giving it faster load time and better data control Features

Dušan Todorović 0 Mar 1, 2022
Solutions to Hackerrank.com practice problems using JAVA, C, Python and MySQL

Solutions to Hackerrank practice problems This repository contains 185 solutions to Hackerrank practice problems. Updated daily :) If it was helpful p

Ankit Seth 1 Dec 28, 2021
It's an 90 days challenge where all important concept of DSA I will be learning and solving using C++ or Java.

#90DaysDSA It's an 90 days challenge where all important concept of DSA I will be learning and solving using C++ or Java. Day 1 & 2 -> Space and Time

Priya_pp 1 Dec 11, 2021
This is the Master Repository for all the different algorithms in the world of DSA, be it in any language C++, Java, Python etc.....

© Dragon ball GT INTRODUCTION The goal of this repository is to have in a single place all possible algorithms and data structures - in multiple langu

Shivanshu Garg 12 Oct 30, 2022
This is a library that can bypass the hidden api restriction on Android 9-12.

BypassHiddenApiRestriction This is a library that can bypass the restrictions on non-SDK interfaces on Android 9-12.

Wind 64 Dec 26, 2022