Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Quality parameter not working #129

Closed
khawerrind opened this issue Jul 24, 2019 · 6 comments
Closed

Quality parameter not working #129

khawerrind opened this issue Jul 24, 2019 · 6 comments

Comments

@khawerrind
Copy link

I am trying to pass in the quality parameter for the jpeg image. However quality does not have any effect on the size of the image.

const imageRequest = JSON.stringify({
    bucket: "----",
    key: "----",
    edits: {
    	resize: {
            width: 300,
            height: 300,
            fit: 'inside'
    	}
    },
    jpeg: { quality: 70 }
});

I tried to change the quality to 40 but the size of the image is same as with quality 60 or even if there is no quality parameter. Am i missing something?

@leviwilson
Copy link

@khawerrind
Copy link
Author

@leviwilson this still does not work. I think this is just for thumbor but i am not using thumbor style mapping.

@leviwilson
Copy link

@khawerrind I think what you want is #116

That allows for the output option to be honored where you can additionally specify the quality I think. That currently isn't being honored, but if you pull that branch that I have it should work for you.

@hayesry
Copy link
Member

hayesry commented Aug 4, 2019

All, FYSA we've added @leviwilson's PR (#117) as referenced in #116 to our review board and hope to have it tested and rolled out in the next minor release. Thanks!

@rromanchuk
Copy link

It would be nice to also add output settings to the demo. I know this wraps Sharp but I'm not confident how I interface with it from my request body, and what is/isn't supported. I'm just starting to dig in the source now and I noticed new concepts like requestType and outputFormat. Does this mean i can theoretically pass in an options hash for even something like this? https://sharp.pixelplumbing.com/en/stable/api-output/#heif

https://github.com/awslabs/serverless-image-handler/blob/9ccdb7180c7881eb78c220f3958b671d968c16dd/source/image-handler/test/test-image-handler.js#L64

const request = {
                requestType: "default",
                bucket: "sample-bucket",
                key: "sample-image-001.jpg",
                outputFormat: "png",
                edits: {
                    grayscale: true,
                    flip: true
                },
                originalImage: new Buffer('iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8z8BQDwAEhQGAhKmMIQAAAABJRU5ErkJggg==', 'base64')
            }

@beomseoklee
Copy link
Member

We have updated our solution, and I believe your issue has been fixed. If you still see the issue with the latest version (v4.2), please feel free to reopen the issue.

You can refer to the recent changes here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants