Releases: sagidM/s3-resizer
s3-resizer 4.0
s3-resizer 4.0
Technically, the interface is still compatible with version 3.x (100x100_max/my-image.jpg
- the path is still the same), but this update brings major changes including using new import/export syntax, so the decision was to jump to a new version. It does not follow semver.
Here is what's new:
- Update the Sharp library: v0.23.3 => v0.32.0
- Update AWS SDK: aws-sdk v2.36.0 => @aws-sdk/client-s3 v3.304.0. The former api contained the whole sdk with 99% unused code whereas the new one contains functions specific to S3.
- Buffers were replaced by streams. The latest versions of both AWS SDK and Sharp support streams, so now it's almost impossible to go out-of-memory if an image is too large (though it is still highly recommended to keep memory big +512mb, you can do that in Configuration->Edit)
- CommonJS => ES Module. And hence
require/exports
=>import/export
. So if the lambda wakes up, it is expected to take less time in the first request. - Reduce zip size containing compiled node_modules: 30mb => 10mb.
- If
?path=
is not set or is invalid, return explaining message andstatusCode: 400
. Previously it wasInternal Server Error
withstatusCode: 500
.
🎉 Compiled and tested for NodeJS 18.x 🎉
# default
npm i --arch=x64 --platform=linux
# without aws libraries
npm i --arch=x64 --platform=linux --only=prod
Use the latter only if you know what you are doing! It does not contain awk libraries in node_modules, so the latest version of the sdk will be used. You can configure auto update of built-in sdk in lambda Runtime settings -> Edit runtime management configuration -> Update runtime version.
s3-resizer
Support:
whitelist of sizes is included; you can use the environment variable WHITELIST #10.
s3-resizer
NodeJS 10x and 12x
Fix: CloudFront redirect #5 and #7 by storing files with the Cache-Control header.
This release consists of the latest NodeJS versions such as 10x and 12x since version 8x is going to be off soon.
Also, the codebase has the modern JavaScript syntax whereas the logic remains the same 2.0.1...3.0.1
The releases have been built on Windows x64 WSL Ubuntu 18.04.3
Node.js 10.x
rm -rf node_modules/
npm i --only=prod --target=10.17.0
zip s3-resizer_nodejs_10.17.0.zip node_modules/ index.js -rq
Node.js 12.x
rm -rf node_modules/
npm i --only=prod --target=12.13.0
zip s3-resizer_nodejs_12.13.0.zip node_modules/ index.js -rq
For non-Linux machines such as OS X and Windows, you have to add
--arch=x64 --platform=linux
http://sharp.pixelplumbing.com/en/stable/install/#aws-lambda
s3-resizer
NodeJS 10x and 12x
This release consists of the latest NodeJS versions such as 10x and 12x since version 8x is going to be off soon.
Also, the codebase has the modern JavaScript syntax whereas the logic remains the same 2.0.1...3.0.0
The releases have been built on Windows x64 WSL Ubuntu 18.04.3
Node.js 10.x
rm -rf node_modules/
npm i --only=prod --target=10.17.0
zip s3-resizer_nodejs_10.17.0.zip node_modules/ index.js -rq
Node.js 12.x
rm -rf node_modules/
npm i --only=prod --target=12.13.0
zip s3-resizer_nodejs_12.13.0.zip node_modules/ index.js -rq
For non-Linux machines such as OS X and Windows, you have to add
--arch=x64 --platform=linux
http://sharp.pixelplumbing.com/en/stable/install/#aws-lambda
s3-resizer
This update contains different NodeJS versions with rotation fix.
Thanks to issue #2 and PR #1
The releases were built with
npm install --arch=x64 --platform=linux --target=6.10.0 sharp
and
npm install --arch=x64 --platform=linux --target=8.10.0 sharp
respectively (more info http://sharp.pixelplumbing.com/en/stable/install/#aws-lambda)
s3-resizer
UPD: You need to choose >>> NodeJS 6.10 <<< in Amazon (see #2)
Upload this "s3-resizer.zip" file to Amazon Lambda
s3-resizer
AWS Lambda for resizing images in S3 on fly.