You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So I am trying to loop through an array of image urls to get the average picture's color. When I go to try using a buffer as a picture source, I get an invalid GIF error of some sort. I then try downloading via an axios stream and am able to view the picture after downloading, but get this Marker was not found error...
Error: marker was not found
at decodeScan (/Users/atechooff/Build/Ideea/Webscraper/node_modules/jpeg-js/lib/decoder.js:324:15)
at constructor.parse (/Users/atechooff/Build/Ideea/Webscraper/node_modules/jpeg-js/lib/decoder.js:744:29)
at Object.decode (/Users/atechooff/Build/Ideea/Webscraper/node_modules/jpeg-js/lib/decoder.js:983:11)
at handleJPEG (/Users/atechooff/Build/Ideea/Webscraper/node_modules/get-pixels/node-pixels.js:32:21)
at doParse (/Users/atechooff/Build/Ideea/Webscraper/node_modules/get-pixels/node-pixels.js:114:7)
at /Users/atechooff/Build/Ideea/Webscraper/node_modules/get-pixels/node-pixels.js:190:7
at FSReqWrap.readFileAfterClose [as oncomplete] (fs.js:511:3)
Here is my code.
let index2 = 0
let interval2 = setInterval(() => {
downloadImage(images.data[index2].sizes[0].url).then((name) => {
console.log('Writting :', objectName, ' to file')
getColors(__dirname + '/images/' + name + '.jpg').then(colors => {
console.log(colors)
if (colors[0]._rgb[2] >= 180) {
console.log('found good image!')
imageLinks.push(images.data[image].sizes[0].url)
}
})
.catch(err => {
console.log("Error! ", err) //This is where I catch the Marker not found error
})
})
if (++index2 == images.data.length) {
console.log('finished looping through images... on to the next array.')
clearInterval(interval2)
}
}, 1000)
This is my downloadImage function just in case there is something wrong with how im downloading.
So I am trying to loop through an array of image urls to get the average picture's color. When I go to try using a buffer as a picture source, I get an invalid GIF error of some sort. I then try downloading via an axios stream and am able to view the picture after downloading, but get this Marker was not found error...
Here is my code.
This is my downloadImage function just in case there is something wrong with how im downloading.
The text was updated successfully, but these errors were encountered: