-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
canvas[method] is not a function #770
Comments
Do you have libjpeg-turbo setup on Windows? (See step 3 of https://github.com/Automattic/node-canvas/wiki/Installation%3A-Windows) |
@zbjornson yes,has been installed to default directory. |
Good. Can you paste the log from when you run |
Any word on this one, I just ran into the same issue. libjpeg-turbo is setup in the default directory |
To help any further, I'd need to see your logs from Also note that JPEG support on Windows requires canvas 2.x (currently in alpha). Try |
Thanks for your help. I went ahead and installed
|
I guess, nobody need this after a year, but I met the same problem with 1.6.11. I follow this guide https://github.com/Automattic/node-canvas/wiki/Installation:-Windows and use default paths. By glancing into sources I noticed that streamJPEGSync is added depending on HAVE_JPEG constant, which seems to be defined in binding.gyp on condition 'with_jpeg=="true"', which seems to be permanently turned off for windows in the very beginning of it Also, in the same section where HAVE_JPEG is defined, the jpeg lib is referenced as Am I missing something here? Should I provide some arguments to npm or node-gyp to override something? |
@adokukin only version 2.x supports JPEG on Windows. We should probably setup stub methods for GIF, SVG and JPEG that provide nicer error messages when you attempt to call a GIV, SVG or JPEG method but don't have the libraries for those extensions. |
`canvas.jpegStream` without JPEG support -> throw errors `img.src = xxx` without support for that format -> emit error Fixes Automattic#770
`canvas.jpegStream` without JPEG support -> throw errors `img.src = xxx` without support for that format -> emit error Fixes Automattic#770
`canvas.jpegStream` without JPEG support -> throw errors `img.src = xxx` without support for that format -> emit error Fixes #770
F:\nodercms\node_modules\canvas\lib\jpegstream.js:44
canvas[method](options.bufsize, options.quality, options.progressive, function(err, chunk){
^
TypeError: canvas[method] is not a function
at ...\node-canvas\lib\jpegstream.js:44:19
at _combinedTickCallback (internal/process/next_tick.js:67:7)
at process._tickCallback (internal/process/next_tick.js:98:9)
Windows 7 64
help me
The text was updated successfully, but these errors were encountered: