question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How can I pass the path of an image from nodejs?

See original GitHub issue

Excuse ignorance, your bookstore looks great. But since nodejs I am running:

node app.js

` // Node.js const javascriptBarcodeReader = require(‘javascript-barcode-reader’)

const code = javascriptBarcodeReader("baaaaar.PNG" /* ImageData */, {
barcode: 'code-2of5',
type: 'industrial', //standard/interleaved optional type
})

`

and I get this error:

C:\xampp\htdocs\barcode3\node_modules\javascript-barcode-reader\src\index.js:29 imageSource = document.getElementById(imageSource) ^

ReferenceError: document is not defined

I’m trying to read the bar code and I need to get the answer. It’s possible? thank you.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:20 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
mubaidrcommented, Oct 15, 2018

No. It will require locating bar-code in the provided image which is not supported yet, maybe in the future I will look into this, but I have no plans right now.

1reaction
nikhilkinkarcommented, Oct 12, 2018

@mubaidr I think it is possibly canvas issue, not the javascript-barcode-reader issue, because I inspected the ImageData, Uint8ClampedArray included all 0. passing on file path instead of ImageData is a great idea.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why Node.js not recognizing image path - Stack Overflow
I'm trying to get my images to load up using node the relative path; however it keeps giving me a 404 error (not...
Read more >
How to fetch images from Node.js server ? - GeeksforGeeks
Parse the incoming HTTP request, to know the requested path. · Check if the path exists to respond to status as success or...
Read more >
How to call an image from the existing folder using Node.JS ...
Install express using the following command: npm install express. Run the server.js file using the following command: node server.js.
Read more >
How To Process Images in Node.js With Sharp - DigitalOcean
Open your terminal and create the directory for the project using the mkdir command: mkdir process_images.
Read more >
Node.js File Paths
Given a path, you can extract information out of it using those methods: dirname : get the parent folder of a file; basename...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found