javascript - Node Canvas/Resemble.js Error: Image given has not completed loading at load -


I'm trying to use in node.

It was very far, but I hit a wall with this.

  function chisimimarity checker () {var resemble = require ("resemble"). Var FS = Requirement ("FS"); Var util = require ("use"); This.admitImage = function (imagePath) {fs.readFile (imagePath, function (error, Faildeta) {if (err) Gden; other {var api = resemble (fileData) .oncomplete (function (data) {console.log (ImagePath ); Console.log (util.inspect (data));});}}); }} New Impressability Checker (). AdmitImage (". / Public / images / test.jpg");   

The result in this error:

  /Users/pcoghill/Projects/imgManip/auth/Servers/Farm/node_modules/resemble/lib/server.js : 38 context.drawImage (hidden image, 0, 0, width, height); ^ Error: Image by loading the load (/Users/pcoghill/Projects/imgManip/auth/Servers/Farm/node_modules/resemble/lib/server.js:38:15) on module.exports.loadImageData not completed the (/ user /pcoghill/Projects/imgManip/auth/Servers/Farm/node_modules/resemble/lib/server.js:11:7) on ObjectkonComplete (/ users / Pcoghill / projects / ImgManip / certification / server / Farm / node_modules / resemble /resemble.js:508:5) on /Users/pcoghill/Projects/imgManip/auth/Servers/Farm/resembleFile.js:14:39 on fs.js: 271: 14 Object.oncomplete (fs. Js: 107: 15)   

I am very new to nodes, so I do not know how the image has not been loaded. This is a local file and I am reading this full callback (either I think).

A little digging around I think it's an issue in the canvas, while reading jpg files, I am struggling to understand the details I've had questions, which looks very similar, but I do not know how this could change in my situation.

Can anyone tell me how I can fix it and what am I doing wrong?

Did you believe that input images can not be valid? After some excavation, I am aware that the node canvas gives a very confusing error message, so "image loading is not complete" could possibly indicate a limitation of errors related to image file. p>

Edit: You can easily install

without setting nodes and JPG support similarities Package, and you will not be warned that JPG is not supported. Unfortunately it seems that adding JPG support is a real pain point; See 2: Only one node-canvas wiki page is found, which specifically names this problem and states that it means that the libjpeg package is unavailable. Install that package, then compile the node-canvas again. See more at

Comments

Popular posts from this blog

ios - Adding an SKSpriteNode to SKScene from a child SKSpriteNode -

Matlab transpose a table vector -

c# - Textbox not clickable but editable -