0
我正在創建一個圖像上傳系統(尺寸通常> 20MB < 50MB),我想將這些圖像裁剪成各種尺寸(用於查看移動,網頁和桌面應用程序),所有圖像都存儲在AWS s3中。在node.js中將較大的圖像裁剪爲多種尺寸
這裏是作物大小的快照
[{
width:200,
height:200,
type:"small",
platform:"web"},
{
width:300,
height:400,
type:"small",
platform:"mobile-android"
}
....
....
]
這裏是想我計劃做
1.首先將圖像上傳到S3。
2.Run在異步任務
upload:function(req,res){
//various cropsizes
var cropSizes = [];
//upload image to s3
uploadImageToS3(req.file,function(err,result){
if(!err){
//create crop
cropImage({
'cropsizes':cropSizes,
'file':req.file
},function(err,result){
console.log('all crop completed',result);
});
res.send('run crop in backgroud');
}
});
}
全部作物操作,但是這是正確的方法?除了這個之外,誰能有更好的東西?
我都試過,但有時AWS拉姆達超時了(在放大圖片的情況下) – Jabaa
多大的圖像,我曾嘗試更大的圖像和它完美地工作,嘗試增加內存限制或Timout從控制檯。 – Yalamber
圖片大小大於20MB – Jabaa