使用ImageMagick清空输入文件

时间:2015-12-14 22:02:07

标签: node.js imagemagick

我在一个节点项目中使用s3-uploader,该项目使用node-im-metadata构建一个引发错误的identify调用:

Error: Command failed: /bin/sh -c identify -format "name=
size=%[size]
format=%m
colorspace=%[colorspace]
height=%[height]
width=%[width]
orientation=%[orientation]
" /Users/Path/To/File.jpg
identify: Empty input file `/Users/Path/To/File.jpg' @ error/jpeg.c/JPEGErrorHandler/322.

    at ChildProcess.exithandler (child_process.js:203:12)
    at emitTwo (events.js:87:13)
    at ChildProcess.emit (events.js:172:7)
    at maybeClose (internal/child_process.js:817:16)
    at Socket.<anonymous> (internal/child_process.js:319:11)
    at emitOne (events.js:77:13)
    at Socket.emit (events.js:169:7)
    at Pipe._onclose (net.js:469:12)

问题是,该文件绝对不是空的。我可以正常加载文件,并多次重新下载图像。该过程一次,但之后它只是一遍又一遍地失败。

如果我直接在CLI中运行identify调用,那么它可以正常工作并返回图像上的元数据。

0 个答案:

没有答案