Image processing with IM4java
记得以前做图片相关需求的时候,使用的是Jmagick+ImageMagick,一直有一个难以解决的问题,就是使用Jmagick之后,往往运行数天后就会导致jboss的jvm崩溃掉。 这几天发现了一个新东西,或能解决这个老问题,记录一下,留备后用,那就是ImageMagick的另外一种java接口:IM4java。 IM4Java和Jmagick不同之处,在于前者不是通过JNI的方式来调用ImageMagick,而是生成命令来调用,据官网上说的,这样做有几个好处, Advantages of im4java: the interface of the IM commandline is quite stable, so your java program (and the im4java-library) will work across many versions of IM. im4java also provides a better OO interface (the "language" of the IM-commandline with it's postfix-operation notation translates very easily into OO-notation). And most important: you can use im4java everywhere JMagick can't be used because of the JNI hazard (e.g. java application servers). im4java的优点:im命令行接口相当稳定,可以适应多种版本的IM,它还提供了友好的OO接口,最重要的是,它不存在“JNI风险” about JNI hazard Running native code using JNI from within java always imposes additional risks. The JVM is no longer sandboxed, so there might be some security issues. In addition, there could be errors like mem...