后台node怎么裁剪图片?
 发布于 13 年前  作者 shinka  13109 次预览  最后一次回复是 12 年前  来自  

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

12 回复
j4cnodejs

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

参考: node-canvas-image-manipulation

a272121742

好东西收藏了

j4cnodejs

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

shinka

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

shinka

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

shaniu00

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)

podou

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

wldlzt

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

yakczh

如何生成驻证码

langzitxp

这个错误如何解决的??

lwen90

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