serverless-image-proxy icon indicating copy to clipboard operation
serverless-image-proxy copied to clipboard

feature request: include pngquant and jpegoptim

Open dohomi opened this issue 8 years ago • 3 comments

Hi

it would be great if this lambda function would also provide image optimization via pngquant and jpegoptim.

Mabe its possible to use similar approach like this package: https://github.com/ysugimoto/aws-lambda-image

Thanks

dohomi avatar Jun 20 '17 00:06 dohomi

Please feel free to create a PR which enables multiple image engines. :shipit:

schickling avatar Jun 20 '17 06:06 schickling

@schickling one question: what happens under the hood if the processing is finished? Is the image persisted with a new path on S3 internally? Are the S3 sources delivered through a CDN?

To contribute to this package I would ne a guidance how to setup the project locally. Haven't used serverless for long time.

dohomi avatar Jun 20 '17 06:06 dohomi

At the moment, the images are just kept in memory and are returned as a base64 encoded string which API Gateway returns as a binary resource.

You can setup the project locally like described here. Unfortunately serverless-offline doesn't support binary return types yet, so you cannot easily test it locally at the moment.

schickling avatar Jun 20 '17 13:06 schickling