Java and GraphicsMagick - Will it work?

I am considering using GraphicsMagick ( http://www.graphicsmagick.org/ ) in a Java project. Does anyone have any experience? Suggestions on how to get started? It seems that there is no native Java library, so it can be a little more complicated.

Thanks!

+4
source share
3 answers

It is definitely possible. Take a look at IM4Java , an abstraction of Java around the command line interfaces of various ImageMagick tools (including GM) that feel language-bound. Very little documentation, but fairly simple. Obviously, your images must be accessible from the OS (for example, not inside ResourceBundles).

+3
source

We did our project with GraphicsMagick and Java, Q & A, here the obvious impact on our solution. This is a long way, but in the end we did it. We have very optimized GraphicsMagick and im4java to get the required performance and reliability. I think I should contribute: http://kennethxu.blogspot.com/2013/04/integrate-java-and-graphicsmagick.html

+7
source

Currently, the only reasonable way to achieve this goal is to use the command line from Java (runtime.exec). You should use im4java for this, as suggested above. im4java allows you to create the string "gm command" using calls to java methods, and also provides a number of other useful functions.

The big advantage of using this method over actual language relationships is its simplicity and reliability. Reliability is important, especially if your Java application runs on a Java server or servlet engine such as tomcat. The reason is that a memory error or other error when using language bindings can cause the failure of the entire Java virtual machine.

+1
source

All Articles