我正在使用 ImageMagick 裁剪图像文件。我正在部署带有 ImageMagick 的打包 WAR。ProcessStarted 类的 searchForCmd() 函数无法从 WEB-INF/classes 中找到 ImageMagick 的文件,即
file:/D:/Project/build/libs/proj-0.0.1-SNAPSHOT.war!/WEB-INF/classes!/ImageMagick-6.6.1-5
如何在打包战争中访问 convert.exe。
下面是堆栈跟踪。
org.im4java.core.CommandException: java.io.FileNotFoundException: convert
at org.im4java.core.ImageCommand.run(ImageCommand.java:219)
at com.os.util.helper.ImageCropHelper.cropImageByImageMagic(ImageCropHelper.java:316)
at com.os.util.helper.ImageCropHelper.cropImage(ImageCropHelper.java:375)
at com.os.action.UserAction.mntnUserAvatar(UserAction.java:2566)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at ognl.OgnlRuntime.invokeMethod(OgnlRuntime.java:899)
at ognl.OgnlRuntime.callAppropriateMethod(OgnlRuntime.java:1544)
at ognl.ObjectMethodAccessor.callMethod(ObjectMethodAccessor.java:68)
at com.opensymphony.xwork2.ognl.accessor.XWorkMethodAccessor.callMethodWithDebugInfo(XWorkMethodAccessor.java:96)
at com.opensymphony.xwork2.ognl.accessor.XWorkMethodAccessor.callMethod(XWorkMethodAccessor.java:88)
at ognl.OgnlRuntime.callMethod(OgnlRuntime.java:1620)
at ognl.ASTMethod.getValueBody(ASTMethod.java:91)
at ognl.SimpleNode.evaluateGetValueBody(SimpleNode.java:212)
at ognl.SimpleNode.getValue(SimpleNode.java:258)
at ognl.Ognl.getValue(Ognl.java:470)
at ognl.Ognl.getValue(Ognl.java:434)