Issue 1059 in zxing: Decoder doesn't like images with transparent "white" space

213 views
Skip to first unread message

zx...@googlecode.com

unread,
Nov 11, 2011, 9:42:11 AM11/11/11
to zx...@googlegroups.com
Status: New
Owner: ----

New issue 1059 by grimblef...@gmail.com: Decoder doesn't like images with
transparent "white" space
http://code.google.com/p/zxing/issues/detail?id=1059

What steps will reproduce the problem?

1. Create a QR code using a transparent "white" area.
2. Paste URL to image into the decoder page.

What is the expected output? What do you see instead?

Should decode. Instead, returns "No barcode was found in this image. Either
it did not contain a barcode, or did not contain one in a supported format,
or the software was simply unable to find it. Go "Back" in your browser and
try another image."

What version of the product are you using? On what operating system?

n/a

Please provide any additional information below.

If you create the same QR code without the transparency, it decodes
correctly. The problem seems to be the decoder doesn't know how to handle
an image with a transparency.

I'm using PNG. Have not tried with GIF etc.


zx...@googlecode.com

unread,
Nov 11, 2011, 11:36:59 AM11/11/11
to zx...@googlegroups.com

Comment #1 on issue 1059 by srowen: Decoder doesn't like images with

Can you provide an example image? I have one here that seems to decode with
a transparent background.

zx...@googlecode.com

unread,
Nov 11, 2011, 11:57:33 AM11/11/11
to zx...@googlegroups.com

Comment #2 on issue 1059 by grimblef...@gmail.com: Decoder doesn't like
images with transparent "white" space
http://code.google.com/p/zxing/issues/detail?id=1059

http://jscottsmith.org/images/isitcode/isitcode.png

It is one of several that will not decode. If I recreate them, using the
same tool but without the transparency, they decode fine.

Also, if they are displayed on screen on a white (or light yellow)
background, they scan fine with the android Barcode Reader app and also the
iOS QR Reader.

Because of this, I don't think it's the QR code itself.

Perhaps it's just something in the way the generator creates the PNG
transparency that's causing the decoder to have issues?

zx...@googlecode.com

unread,
Nov 11, 2011, 12:20:05 PM11/11/11
to zx...@googlegroups.com

Comment #3 on issue 1059 by smpar...@smparkes.net: Decoder doesn't like
images with transparent "white" space
http://code.google.com/p/zxing/issues/detail?id=1059

FWIW, this looks to be in the Java image processing stuff. The png decodes
fine in C++, which uses ImageMagick to read the png data.

The luminance data coming out of the luminance source in Java is all black.

zx...@googlecode.com

unread,
Nov 11, 2011, 12:36:27 PM11/11/11
to zx...@googlegroups.com

Comment #4 on issue 1059 by grimblef...@gmail.com: Decoder doesn't like
images with transparent "white" space
http://code.google.com/p/zxing/issues/detail?id=1059

I'm not a graphics guy, nor a c++ or java coder, but... is there no way to
tell the java module you want transparency to default to white when
decoding images with transparency?

zx...@googlecode.com

unread,
Nov 11, 2011, 1:31:07 PM11/11/11
to zx...@googlegroups.com

Comment #5 on issue 1059 by srowen: Decoder doesn't like images with

Nevermind yeah I have a good example here too. Yeah I think the grayscale
conversion in BufferedImage isn't doing the right thing here. I need to
strip the alpha channel, or tell it to think of it as white. I can do
it "manually" but will look for an easy one-liner for a bit.

zx...@googlecode.com

unread,
Nov 12, 2011, 6:09:26 AM11/12/11
to zx...@googlegroups.com
Updates:
Status: Fixed
Owner: srowen
Labels: Type-Defect Priority-Medium

Comment #6 on issue 1059 by srowen: Decoder doesn't like images with

I'll upload to the zxing.org server soon

Reply all
Reply to author
Forward
0 new messages