Why not just call imagemagick directly with cfexecute?
Mark
Sent from my mobile doohickey
--
Did you find this reply useful? Help the Railo community and add it to the Railo Server wiki at https://github.com/getrailo/railo/wiki
---
You received this message because you are subscribed to the Google Groups "Railo" group.
To view this discussion on the web visit https://groups.google.com/d/msgid/railo/aaf2da5c-1879-4c5c-b5dc-a90c70294ae5%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
--
Did you find this reply useful? Help the Railo community and add it to the Railo Server wiki at https://github.com/getrailo/railo/wiki
---
You received this message because you are subscribed to the Google Groups "Railo" group.
To view this discussion on the web visit https://groups.google.com/d/msgid/railo/2984b119-eb0c-4e79-9e49-f757dcf18e47%40googlegroups.com.
I use cfexecute with absolute path to the imagemagick files - works great with similar performance for just a few simple commands like info / crop / resize. If you need to do many operations on a file, you probably need to look at using PHP. Like I made a whitespace trimming + resize + crop feature with php gd library functions. It would be slower using many cfexecute operations. This is why using java libraries would be superior since you could operate on the data in memory in complex ways.
If not, that would be bad.
--
Did you find this reply useful? Help the Railo community and add it to the Railo Server wiki at https://github.com/getrailo/railo/wiki
---
You received this message because you are subscribed to the Google Groups "Railo" group.
To view this discussion on the web visit https://groups.google.com/d/msgid/railo/e0809dd3-569c-4a66-be68-736374cd2ace%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
-- Igal Sapir Railo Core Developer http://getRailo.org/
imgscalr is an very simple and efficient (hardware accelerated) “best-practices” image-scaling library implemented in pure Java 2D; as of the 4.0 release imgscalr now includes a handful of other convenience image operations, all as easy to use as resize.
This library makes uses of efficient Java2D scaling techniques advocated by the Java2D team which provides hardware accelerated operations on most platforms.
If you have ever wanted to quickly resize an image in Java you have probably noticed the following confusing things:
imgscalr addresses all these issues.
The simplest use-case of the library for resizing an image is a single 2-argument method call:
BufferedImage thumbnail = Scalr.resize(image, 150); |
In this use-case we pass the library our image and ask it to fit the image (while maintaing its original proportions) within a width and height of 150 pixels.
Alternatively, if we wanted some finer-grained control over how our image is scaled, quality used and possibly a light anti-aliasing filter to it (to make it look smoother) our method call would look something like this:
BufferedImage thumbnail = Scalr.resize(image, Scalr.Method.SPEED, Scalr.Mode.FIT_TO_WIDTH, 150, 100, Scalr.OP_ANTIALIAS); |
You can see that we a slew of knobs and levers to change when using the library. A few things worth noting are the Method and Mode enums defined on the Scalr class. These enums are used in conjunction with all of the resize methods.
Usability Tip: Java’s static imports makes using imgscalr a walk in the park, consider the following snippet of code to see how easy it becomes:
import static org.imgscalr.Scalr.*; public static BufferedImage createThumbnail(BufferedImage img) { // Create quickly, then smooth and brighten it. img = resize(img, Method.SPEED, 125, OP_ANTIALIAS, OP_BRIGHTER); // Let's add a little border before we return result. return pad(img, 4); } |
Of course we could have inlined the resize directly inside of the pad call, but for readability I split them up; either way, you see how simple it is to use imgscalr in your projects.
There are a set of other operations we can do to our image, like rotating it, padding it, cropping it and so on.
This library is intended for developers needing to quickly resize or manipulate images (using the correct or most optimal methods available in native Java) and move one with their lives.
imgscalr is general purpose and will work on any platform providing the base Java2D classes it uses. imgscalr was also written with web application’s in mind, possibly needing to generate thousands of thumbnails or previews from larger uploaded images.
This library is not meant to be a full-scale Java graphics library like JAI.
--
Did you find this reply useful? Help the Railo community and add it to the Railo Server wiki at https://github.com/getrailo/railo/wiki
---
You received this message because you are subscribed to the Google Groups "Railo" group.
To view this discussion on the web visit https://groups.google.com/d/msgid/railo/3504188e-7477-4064-9efb-0a61902a657f%40googlegroups.com.