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

Resize SVG is returning 200 with a broken image #234

Closed
5 tasks done
AhmedRagheb opened this issue Sep 25, 2020 · 4 comments
Closed
5 tasks done

Resize SVG is returning 200 with a broken image #234

AhmedRagheb opened this issue Sep 25, 2020 · 4 comments
Labels

Comments

@AhmedRagheb
Copy link

AhmedRagheb commented Sep 25, 2020

Describe the bug
Resize SVG is returning 200 with a broken image

To Reproduce
Resize SVG with any mode and It will return 200 with a broken image

Expected behavior
Resize SVG should return the 200 with a resized image.

Please complete the following information about the solution:

  • Version: [e.g. v5.0.0]
  • Region: [e.g. eu-west-1]
  • Was the solution modified from the version published on this repository? No
  • Have you checked your service quotas for the sevices this solution uses? Yes
  • Were there any errors in the CloudWatch Logs? No

Screenshots
(https://user-images.githubusercontent.com/12202990/94241773-60b39780-ff15-11ea-9f87-6f5de2352da3.png)

@MartijnKooij
Copy link

MartijnKooij commented Sep 25, 2020

I'm seeing the same issue after upgrading to 5.0. SVG resizing worked fine in version 4.1 which we used before.

If I look at the HTTP response for my resize request I do see something that looks like PNG binary data but I cannot get it to render.
Also the content-type response header is wrong, it says image/svg+xml instead of something like image/png.

Edit, we are using the SharpJS syntax: {"bucket":"our.bucket.org","key":"icons/123.SVG","edits":{"resize":{"width":40,"height":40,"fit":"fill"}}}

@beomseoklee
Copy link
Member

@AhmedRagheb and @MartijnKooij
I'm sorry to hear that you experienced a same issue. Please allow us to investigate the issue.

@beomseoklee
Copy link
Member

Thanks for waiting. v4.2 was broken, so every image was return as image/webp, and v5.0 fixed that issue so if you don't set AUTO_WEBP to 'Yes' at the Lambda function's environment variables, the Lambda function is going to return the original content-type which is image/svg+xml.

The possible simple workaround is to change AUTO_WEBP to Yes at your Lambda function. We will consider how we can handle this one in the next release.

@beomseoklee
Copy link
Member

Thanks for waiting @AhmedRagheb and @MartijnKooij
We've released v5.1.0, and the new version will return image/svg+xml if there's no change. If there's any changes, it changes the image format to image/png because that's how sharp works by default.

thisismana added a commit to thisismana/serverless-image-handler that referenced this issue Oct 5, 2023
* thumb hash — initial check in

Thumbnail generator based on [thumbhash](https://evanw.github.io/thumbhash/) implemented as a lambda function URL with/in Rust.

* rust pr pipeline

* rust pr pipeline

* rust pr pipeline

* rust pr pipeline

* rust pr pipeline

* rust pr pipeline

* export function URL to ssm param store
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants