ysugimoto / aws-lambda-image

Automatic image resize/reduce on AWS Lambda
MIT License
823 stars 219 forks source link

Enhancement - parameter to double the size with @2x #213

Open johndpope opened 3 years ago

johndpope commented 3 years ago

https://cdn.shopify.com/s/files/1/0023/8639/5172/products/3_0-2_1_1024x1024@2x.jpg?v=1569423464

While it's trivial to just manually double the size / dimensions it would be a nice to have to pass in @2x somewhere in the url to upscale this.

/100x100/. -> @2x would upscale to 200x200

phy25 commented 3 years ago

This seems to be something configurable with ImageMagick syntax: https://imagemagick.org/script/command-line-processing.php#geometry - you can either upscale or downscale.

I don't understand why you want to upscale your image though - you are not improving the image dimension in any way by upscaling.

johndpope commented 3 years ago

technically if the original image is say 1mb - 1000x1000 pixels- and you mostly want 100x100 - but for retina - you want @2x it would be 200x200 - the phone would be downloading a larger (though not largest) resolution.

johndpope commented 3 years ago

fyi https://github.com/awslabs/serverless-image-handler