Reputation: 187389
I have a form wherein the user will be able to provide an image either by:
Once the image is provided, the user should be able to select an area of the image to be cropped using a JavaScript control. The cropped image will be resized to have a standard width. I may use an image hosting service (e.g. ImageShack) to store the image online instead of in the local filesystem. So to summarize, the functionality I'm looking for is:
Is there a Grails plugin or Java library that can meet these needs?
Upvotes: 2
Views: 2098
Reputation: 3532
I imagine that the selection process is fairly easy given a javascript plugin ( http://odyniec.net/projects/imgareaselect/).
I think the state of the art in the Grails world for resizing images would be the burning image plugin ( http://grails.org/plugin/burning-image ).
The image quality you get from it is not spectacular. You can also call imageMagick directly via groovy, but the setup and portability of this is not great.
Personally, I would go for a simpler library like ImgScalr - http://www.thebuzzmedia.com/software/imgscalr-java-image-scaling-library/
So the pieces are all there, but there isn't really a plugin that will do all of this for you in the Grails world.
You might also take a look at Gaelyk and the Google App Engine, as the image resizing support there is much nicer and more portable.
Upvotes: 2
Reputation: 156534
Most of the image manipulation functionality you are seeking can be handled directly by the Java APIs (standard edition), e.g. in classes BufferedImage
and AffineTransform
.
Many simple examples can be found on the web by searching for "java resize image", for example.
Upvotes: 1