How can I pass the path of an image from nodejs?
See original GitHub issueExcuse 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:
- Created 5 years ago
- Comments:20 (9 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
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.
@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.