As per our project requirements we need to save artworks (images with JPG, PNG, TIFF etc image formats) which can size anywhere from 1KB to 1MB. We are now storing them in AWS S3 bucket.
I have below few questions on our implementation:
import java.awt.*;
import javax.imageio.*;
import org.imgscalr.Scalr;
void createThumbnailUsingScalr(File sourceImage) throws Exception {
File destImage =
new File("/Path/For/Destination/Thubnail.png");
BufferedImage img = ImageIO.read(sourceImage);
BufferedImage thumbImg = Scalr.resize(img, Scalr.Method.QUALITY, Scalr.Mode.AUTOMATIC, 200, 200, Scalr.OP_ANTIALIAS);
ImageIO.write(thumbImg, "PNG", destImage);
}
This above code is little bit helping my needs