Open joseph-animasds opened 4 years ago
Hi! Could you supply the source images? Also, could you check it against https://github.com/ericblade/quagga2 and if it's still broken in that version, file there?
Thanks!
I also tried with quagga2 and with the same image I get same error.
so is that the pdf input, or the input to sharp, or the input to quagga? just to clarify. and that is a code 128? i don't instantly recognize barcode types :-) Do you know what that should translate to when successfully read?
ok, so... i'm not real sure exactly how to "fix" this.. as a person, i can clearly see the edges of the barcode.. i've had mixed success however feeding that file to other barcode scanner softwares.
What I have had success doing, however, is in bumping the file size up -- i took it into gimp, and pasted it, centered, into a new 1200x200 file -- and then quagga is able to read it using an image width of 1600 (i suspect it might need more white space padding than it has, but i have not yet tried putting in more in the source image)
I'm using the following settings on the example page https://serratus.github.io/quaggaJS/examples/file_input.html
As is, your inputStream.size parameter is too small -- you may also be able to solve this by resizing the image down to 800 or fewer pixels width . . . but i suspect you'll also still need to add whitespace around it.
fwiw, setting the tester to 1280px with the 1200x200 image almost works, the tester gives a green box around it, seeming to indicate that it has found something it thinks should be a barcode, but not a good result.
i was also able to add this image to the test suite and get it to run from node, using the same settings, however increasing the inputstream size to 1600 in node currently seems to break several of the other code 128 test images.
thanks @ericblade
My code: ` const express = require('express') const app = express() const port = 3000 const sharp = require('sharp'); const Quagga = require('quagga').default
//pdftoppm test.pdf test -png -f 1 -singlefile -rx 300 -ry 300
app.get('/', (req, res) => { let originalImage = 'pdf/test.png';
})
app.listen(port, () => console.log(
listening on ${port}
)) ` and the error: