ZXing libraries cannot be detected

I am unable to figure out how to put these libaries into my folder, I’ve searched everywhere and I’ve tried all I could. I put the “core” folder inside the libaries folder currently. Can anyone help with a solution?

This is my code.

import processing.video.;
import java.util.List;
import com.google.zxing.
;
import com.google.zxing.client.j2se.BufferedImageLuminanceSource;
import com.google.zxing.common.HybridBinarizer;
import java.awt.image.BufferedImage;
Capture video;

void setup() {
size(640, 480);
video = new Capture(this, 640, 480);
video.start();
}
void draw() {
if (video.available()) {
video.read();
BufferedImage image = (BufferedImage) video.getNative();

LuminanceSource source = new BufferedImageLuminanceSource(image);
BinaryBitmap bitmap = new BinaryBitmap(new HybridBinarizer(source));

try {
  Result result = new MultiFormatReader().decode(bitmap);
  String barcode = result.getText();
  println("Barcode detected: " + barcode);
} catch (NotFoundException e) {
  // No barcode was detected
}

}
}

No library found for com.google.zxing
No library found for com.google.zxing.client.j2se
No library found for com.google.zxing.common
Libraries must be installed in a folder named ‘libraries’ inside the sketchbook folder (see the Preferences window).
The package “com.google” does not exist. You might be missing a library.

Hi @Crimsic,

simply drag and drop the corresponding jar files onto the PDE Window.
It will create then a code folder in you sketch directory which makes the libraries work.

Cheers
— mnse

1 Like

Hi @mnse ,
Although I have dragged some of the jar files that was required, it still unable to detect the package. The requested files are folders so am I to assume to drag every single file into the PDE window?
Thanks

Hi @Crimsic,

At least the ZXing core and the ZXing javase jars as far as I can see from your code imports above.
If something missing you need to check which jars else and also drop it onto the PDE window.
In the end you should have a code directory in your sketch folder which have all the required jars located inside flat without subfolders.

Cheers
— mnse

download @Crimsic,

Welcome!

I had just made a note about QRCodes for my work to do’s for new year.

It helps us help you if you:

  • Format your code < Open this link.
  • Provide details about the the resources you are using; in this case the libraries.
  • Details about your environment (OS, Processing version).

This worked here with Processing 4.1.1 and W10:

The toughest part was finding a QRCode that was printed so went to Google Images.

It is also here available with Processing in the Contribution Manager which is the easiest way to install:

I checked this after downloading and installing and looks like I did this correctly… says 3.5 installed.

:)

Remember that the BufferedImage class does not exist in Android and this library cannot be used in Android. A few weeks ago I ported this library to Android so that it would work well, it would be great if the official maintainer updated it…

1 Like