简体   繁体   中英

Java Image resizing (3 sizes) upload each to Amazon S3

I'm using grails with jetS3t to upload an image to S3, this works fine.

But now I need to re-size the image (thumbnail, small and medium) and upload them all to S3.

So far I'm thinking about using ImageMagick, But don't know which is the best way to approach the resizing.

Should I:

Upload original to S3, then re-size using the URL received from S3(another download), and upload the re-sized image to S3, (x3)

OR

Upload and use image bytes in memory, do all the resizing, upload the 3 re-sized photos and the original to S3

Depends on your quality requirements and memory availability.

If you want the resized images to be good quality then using ImageMagick is probably a good option but that requires the source image to be saved locally on disk. On the other hand, you won't need to store all images in memory. Im4Java worked very well for me as an interface to IM.

Using the Java Graphics package and BufferedImage class you can do an in-memory operation but this might not produce as good quality images.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM