Re: Issue with GM through JNI
Bob Friesenhahn <[email protected]>
| Newsgroups | gmane.comp.video.graphicsmagick.help |
|---|---|
| Message-ID | <[email protected]> |
On Mon, 10 Jul 2017, Tianyu Lang wrote: > Hi Bob, > > Thanks for the super quick reply. > nullptr is basically the C++ version of NULL and it is not a Java/JNI > specific thing, so I don't think it could cause a huge problem. Eventually I learned that it is a C++'11 thing. > Additionally. I have tried compiling my JNI wrapper as C (which uses NULL) > instead of C++ and it has the same problem. > > The passed argument could be an issue. My OS is Ubuntu 14.04.5 LTS x86_64 > GNU/Linux. For testing purposes, what should I pass in as the argument for > InitializeMagick just to be safe? Should I pass in the path > for libGraphicsMagickWand.so.2, for example /usr/local/lib/ > libGraphicsMagickWand.so.2? I doubt that the passed argument matters at all. What is your locale (internationalization stuff) set to? > Also, I have a question about the GM CLI tool. One of the biggest problem > for me about the CLI tool is that it has to write to disk, which is very > slow. I did a small test and writing to disk is doubling the processing > time. So is there a way where I can pipe in images and have GM pipe out the > result so I can bypass the disk? If I can do that, I would not need the JNI > stuff. Plus, I have not encountered any problems running GM CLI tool as a > separate process with gm4java. It is often possible to bypass the disk. For example, you could run this in a pipe (using stdin is specified by the '-' and using stdout is also specified by the '-'): ~~~~~~~~~~~~~~~~~~~~~~~~~~ gm convert - -rotate 90 jpeg:- ~~~~~~~~~~~~~~~~~~~~~~~~~~ In some cases temporary files will be created because an involved format requires it. Test a pipeline like ~~~~~~~~~~~~~~~~~~~~~~~~~ cat input.jpg | gm convert - -rotate 90 jpeg:- | cat > output.jpg ~~~~~~~~~~~~~~~~~~~~~~~~~ You could also consider putting the files which are read and written in a RAM disk or in a tmpfs filesystem. Bob -- Bob Friesenhahn [email protected], http://www.simplesystems.org/users/bfriesen/ GraphicsMagick Maintainer, http://www.GraphicsMagick.org/ ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot