meltingice / CamanJS

Javascript HTML5 (Ca)nvas (Man)ipulation
http://camanjs.com
BSD 3-Clause "New" or "Revised" License
3.56k stars 406 forks source link

JPG: "Image given has not completed loading" #213

Open lapidus opened 7 years ago

lapidus commented 7 years ago

I am experiencing a somewhat odd issue ... For JPG images (such as the attached one) that was downloaded with nodejs (fs.writeFile), Caman gives this error:

Image given has not completed loading
    at Caman.finishInit /node_modules/caman/dist/caman.full.js:463:22
    at Caman.nodeFileReady /node_modules/caman/dist/caman.full.js:372:19
    at node_modules/caman/dist/caman.full.js:7:61
    at FSReqWrap.readFileAfterClose [as oncomplete] (fs.js:416:3)

If I open this image in the browser and resave it, Caman will not produce any errors. Hence I suspect there is some kind of "JPG header" that Caman needs to interpret the JPG properly? Did anyone else try Caman on a .jpg that was created via fs.writefile? Any ideas appreciated ...

0ab695ba-6994-11d7-ae76-0004755038ce

kakaggarwal commented 6 years ago

Is anyone working on this ?