Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Image not found #59

Open
Manasseh-Ankrah opened this issue May 24, 2022 · 4 comments
Open

Image not found #59

Manasseh-Ankrah opened this issue May 24, 2022 · 4 comments

Comments

@Manasseh-Ankrah
Copy link

I'm unable to print image from URL. I also tried using printImageBase64 but it prints out random characters.
code:
Printer.printImage(https://static01.nyt.com/images/2012/10/31/dining/31STUFF_APPLES/31STUFF3-jumbo.jpg, {
imageWidth: 300,
imageHeight: 300,
});

result: image not found

@Florent75
Copy link

Florent75 commented Jul 20, 2022

Hi there,

I do have the same issue.

I am working on a Samsung Tablet.

I have tried the example of the repository, everything is working and being printed.
Then I tried specific text for my project, everything is working and being printed.
Then I tried to add the printImage function and I got a "Image not found" error.

Here is the piece of code :
USBPrinter.printText("Bon d'achat valable chez :");
USBPrinter.printText("BOCOLOCO");
USBPrinter.printText("Magasin 1 & 2");
USBPrinter.printText("Tous les jours de la semaine");
USBPrinter.printText("Magnifique");
USBPrinter.printImage('https://sportshub.cbsistatic.com/i/2021/04/09/9df74632-fde2-421e-bc6f-d4bf631bf8e5/one-piece-trafalgar-law-wano-anime-1246430.jpg');
USBPrinter.printText("453.45 €");

What I have tried :

  • Local image using require
  • Adding width and height params
  • Changing URL

Nothing is working. Do you have any solution ?

Here is my config, it's a fresh new app created 2 weeks ago :
"react": "^18.0.0",
"react-native": "0.69.1",
"react-native-thermal-receipt-printer-image-qr": "^0.1.9",

Regards

@thiendangit
Copy link
Owner

@Florent75 i use this function to check you image url. you can try debugging here.

final Bitmap bitmapImage = getBitmapFromURL(imageUrl);
if (bitmapImage == null) {
errorCallback.invoke("image not found");
return;

@Florent75
Copy link

Thanks.
I will have a look and get back to you.

@Florent75
Copy link

Hi there,

I updated the sdk version and now the image with URL is working.

Regards

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants