2

现在,我正在使用 im4java 和 imageMagick 来处理图片。最近总是出现

org.im4java.core.CommandException:返回码:137

同时我的应用服务器Tomcat7.0也会崩溃。

当然,我的程序是在linux下运行的。不知道怎么办。求帮忙谢谢!我的代码是

public static void cutImage(int width, String srcPath, String newPath) throws Exception {
    IMOperation op = new IMOperation();
    op.addImage(srcPath);
    op.resize(width, null);
    op.addImage(newPath);
    ConvertCmd convert = new ConvertCmd();
    convert.run(op);
}

当我调用这个方法时,有时会发生这种现象。

4

1 回答 1

1

通过从视频生成缩略图,我遇到了一个类似的问题。就像在 zawhtut 的评论中一样,该过程从某个地方被杀死。我的第一个解决方案是减小图像的大小(从 1920 像素到 256 像素)

于 2015-05-12T07:31:39.577 回答