I must say it is dog-slow on my laptop so I can only imagine what it
will be like on the server. Is the image tools plugin
(http://grails.org/ImageTools+plugin) faster?
Also, I'm trying to figure this next part out. Some players have
already uploaded pics, but now I want to use the smaller, scaled
version instead. Should I:
a) force them to reupload and I can scale and store the original and
the scaled copy
b) on subsequent calls to get the image look for a scaled image and if
it doesn't exist create, store and return?
We're only talking a few at this point. So a) might be a good option
and something to use going forward.
Thanks!
-warner
Unfortunately, I've been really disappointed in the output quality of
anything using JAI (including ImageTool). Here's a blog post which
shows an example the quality issues I'm seeing:
http://www.darcynorman.net/2005/03/15/jai-vs-imagemagick-image-resizing/.
In the end, I'll probably end up using ImageMagick, GraphicsMagick, or
possibly a service like TransloadIt.
For regenerating your images at a different size, maybe a quick Grails
Console script would help?
http://www.grails.org/plugin/console
Assuming you already have higher resolution copies, you could create a
script to walk through all your users, resize the photos, and store
both copies.
Good luck :)
Pete
> --
> You received this message because you are subscribed to the Google Groups "Grails Startup Support Group" group.
> To post to this group, send email to grails-startup...@googlegroups.com.
> To unsubscribe from this group, send email to grails-startup-suppo...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/grails-startup-support-group?hl=en.
>
There is also a burningimage plugin which seeks to improve image
quality from imagetools. In our tests, Imagetools simply did not give
us the right quality of image.
http://www.grails.org/plugin/burning-image
If you decide to go the imagemagick route, be aware that it requires a
bit of configuration and installing this on your server is
non-trivial. For www.cruiselinefans.com, we found that since we were
mostly writing the code in Windows machines and our server was a
Solaris box, there was a lot of pain getting settings that were
compatible across both versions.
For our current app, image quality was absolutely important, so I
rewrote some proof-of-concept code to resize using the google app
engine imageservice and call a remote service in a gaelyk app -
http://fbflex.wordpress.com/2010/05/03/manipulating-images-on-the-google-app-engine-with-gaelyk/
This is going to be slower than doing it on the local machine, but
guarantees portability across operating systems and no server setup.
Guillarme did some refactoring on the image service stuff in gaelyk,
so our resizing code that simply takes a jpq and makes an avatar out
of it looks like this:
https://gist.github.com/823374
Note that this is just a 'bake your own webservice' mechanism. It
gives me the best image results with the least amount of work, I don't
integrate with an API and it guarantees that my images are cropped /
resized the way I want.
Here's what is weird, the first half of the image renders in the first
5 seconds, the rest takes 55 seconds to finish and spit out. So
something odd is definitely going on. Something to investigate.
Thanks again!
-warner
The obvious tip here is to also use S3 and Cloudfront. Cloudfront is
the content distribution layer on top of S3 and you can set expiry
dates and headers on the files you upload. It tends to make your
downloads faster since images are pushed to edge locations.
The basic workflow we go through is as follows -
- Upload original image to S3 with JetS3t.
- Schedule an image resize with Gaelyk by calling the resize groovlet
and passing in the S3 url.
- Download the processed image from Gaelyk
- Upload the processed image into S3 - this sets expiry headers.
- Putting the image into a cloudfront bucket exposes it to the CDN, so
it becomes served from Amazon edge locations.
We use the Executor plugin to offset the image resizing so the image
uploaded returns right away.
We also warm up the Gaelyk instance before we call the actual resize.
If I was to write this again, I would have the image be uploaded
directly into the google app engine and store the different image
sizes into the blobstore. GAE then becomes our CDN.
Be aware that if you choose the app engine route, Jets3t is not
compatible with the App Engine, but there are a few libraries out
there that will do the same work.
To give you an idea of the quality of the images in the google app
engine, here are a few samples -
Large - http://static.secretescapes.com/sales/33/4018af66_ae40_47e2_bdd7_b6254d093d6f_large.jpg
Medium - http://static.secretescapes.com/sales/33/4018af66_ae40_47e2_bdd7_b6254d093d6f_medium.jpg
Small - http://static.secretescapes.com/sales/33/4018af66_ae40_47e2_bdd7_b6254d093d6f_thumb.jpg
-warner
-warner
-warner