question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

"The converted image is too large to return." for large JPG images

See original GitHub issue

Describe the bug I’m storing multiple JPG images in my S3 bucket (from 1-16MB). When I try to request some with the Serverless Image Handler only a few are returned when specifying no edits (requesting the original image). For images that are over 5MB file size I’m getting the following error: { "status": "413", "code": "TooLargeImageException", "message": "The converted image is too large to return." }

To Reproduce Upload multiple JPG images to the S3 bucket with a file size between 1 and 10MB. Then try to request the images with the Serverless Image Handler without specifying any edits, so that the original image is returned.

Expected behavior Returning the original image from the S3 bucket.

Please complete the following information about the solution:

  • Version: v5.1.0
  • Region: eu-central-1
  • Was the solution modified from the version published on this repository? No
  • If the answer to the previous question was yes, are the changes available on GitHub?
  • Have you checked your service quotas for the sevices this solution uses? Yes
  • Were there any errors in the CloudWatch Logs? The same error as mentioned above is in the CloudWatch log.

Additional context If I’m adding a width and height with both 0 to the request URL the original image is returned without any problems. Like this: https://images.mydomain.com/0x0/my-image.jpg

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
beomseokleecommented, Dec 14, 2020

@marco910 Handling the images from S3 buckets would be a good option, and we also put this one into our backlog item so that we can handle the images larger than Lambda limit.

1reaction
beomseokleecommented, Dec 10, 2020

@marco910 Thanks for your feedback. By default, we don’t return the original image when any failure happens. Instead, we return the error message. Therefore, if edited images or original images without any edits are larger than 6MB, it returns TooLargeImageException error; inside the Lambda function, it returns the image binary with base64 encoded, so the return size would be bigger than actual image size.

If you put 0x0, it will not resize your image, but it will use inside as fit value, so there would be a chance that the returned images are smaller than the original size.

Read more comments on GitHub >

github_iconTop Results From Across the Web

"The converted image is too large to return." for large JPG ...
Describe the bug I'm storing multiple JPG images in my S3 bucket (from 1-16MB). When I try to request some with the Serverless...
Read more >
Turn off picture compression - Microsoft Support
Turning off picture compression improves picture quality, but uncompressed pictures could result in very large file sizes. Note: The steps to turn off ......
Read more >
Error Message: There are errors below. Hover over each for ...
CMYK images have larger file sizes that may prevent uploads. If the file size is small enough to upload it's automatically converted the...
Read more >
JPG created from UIImage created from CIImage 3x too large
This will return an image based on your screen scale. If you check your screen scale it will result in 3X. What you...
Read more >
Easy Ways to Reduce a JPEG File Size - TinyIMG
Sometimes, JPEG files can be larger than expected. They may take up too much space on your storage, make website load speed slow, ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found