I need to render jpeg images on nodejs serverside. I install canvas npm module with following build instructions: https://github.com/Automattic/node-canvas/wiki/Installation---Windows I have C:\libjpeg-turbo\ as it is mentioned in the manual. If I do:
npm install canvas
then this piece of code doesn't launch onload:
var data = fs.readFileSync("./t.jpg"); var img = new Image();
img.onload = function () {
console.log("onload");
};
img.src = data;
(it works with .png data). If i specify --with-jpeg in my command line, then MSVC complains about missing libjpeg.h. Right after this npm deletes file with msvc project, so I am unable to set paths myself (is it possible to switch off this cleanup?)
So how can I build canvas for windows with jpeg support? Found questions but no answers regarding this topic on the net.
Looks to me like binding.gyp is missing an 'include_dirs' directive at line #143 so the compiler can find libjpeg.h in the C:\libjpeg-turbo\ directory. Try inserting: