0
我試圖實現一些圖片上傳到我的webapp。 即時通訊的問題是,即時通訊嘗試使用Imagescalr創建原始照片的大拇指,並使用AWS插件將其上傳到我的存儲桶。 所以,我的代碼如下:(刪除驗證和事情,不影響問題/更多鈔票答案)ImageScalr + Grails + 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?
所以問題/問題沿着代碼解釋,希望有人知道如何做這個。提前致謝。