我正在尝试将一些图片上传到我的 webapp。我遇到的问题是我试图使用 Imagecalr 创建原始照片的缩略图,并且我使用 AWS 插件将它们上传到我的存储桶。所以,我的代码如下:(删除的验证和不影响问题/可能答案的东西)
def uploadPic() {
def f = request.getFile('file')
.
.
.
def s3file = f.inputStream.s3upload(filename) { //this is for the normal photo
path "POI/ID/"
}
def imageIn = ImageIO.read(???); //Dont know if I can put the f file here as parameter... do I have to store it somewhere first, call the s3 file, or I can resize on - the - fly?
BufferedImage scaledImage = Scalr.resize(imageIn, 150);
//Here I should upload the thumb. How can I call something like what is done for the normal photo?
因此,问题/问题在代码中进行了解释,希望有人知道如何做到这一点。提前致谢。