后台node怎么裁剪图片?
发布于 12 年前 作者 shinka 11663 次浏览 最后一次编辑是 8 年前

是不是需要用到Node的canvas模块? 有其他好主意吗?

12 回复

如果只需剪裁(Crop)和缩放(Resize), 用不到画布(Canvas)画图的话, 用graphicMagic 就够了: GraphicMagic for Node

参考: node-canvas-image-manipulation

好东西收藏了

人类已经无法阻止cnodejs被XSS了!

非常感谢! 我吃完晚饭就试试去!

谢谢啊! 我一会儿就去试试

windows7 下报错

enter code here
   events.js:72
    throw er; // Unhandled 'error' event
          ^

Error: spawn ENOENT at errnoException (child_process.js:975:11) at Process._handle.onexit (child_process.js:766:34)

我用imagemagick模块的时候也出现了这个错误

建议用gm,然后还是不要在windows上玩node.js啦,linux很容易接受的

如何生成驻证码

这个错误如何解决的??

@langzitxp 你试试 npm install -g phantom 然后把C:\Users\LWen\AppData\Roaming\npm\node_modules\phantomjs\lib\phantom 的phantomjs.exe 拷贝到\Roaming\npm\下。。

回到顶部