prisma-archive / serverless-image-proxy

Resizes images using a Lambda function (aka Serverless Thumbor)
103 stars 11 forks source link

feature request: include pngquant and jpegoptim #6

Open dohomi opened 7 years ago

dohomi commented 7 years ago

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

schickling commented 7 years ago

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

dohomi commented 7 years ago

@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.

schickling commented 7 years ago

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.