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

Alllow setting limitInputPixels with Sharp #8886

Closed
1 task
orf opened this issue Oct 22, 2023 · 3 comments · Fixed by #9546
Closed
1 task

Alllow setting limitInputPixels with Sharp #8886

orf opened this issue Oct 22, 2023 · 3 comments · Fixed by #9546
Labels
- P2: nice to have Not breaking anything but nice to have (priority) feat: assets Related to the Assets feature (scope) help wanted Please help with this issue!

Comments

@orf
Copy link

orf commented Oct 22, 2023

Astro Info

Astro                    v3.3.2
Node                     v18.16.0
System                   macOS (arm64)
Package Manager          npm
Output                   static
Adapter                  none
Integrations             @astrojs/mdx
                         @astrojs/sitemap
                         @astrojs/preact
                         @astrojs/tailwind

If this issue only occurs in one browser, which browser is a problem?

No response

Describe the Bug

I have a large image that I would like to embed in one of my pages.

Locally this fails with:

Server Error: Error: Input image exceeds pixel limit

Which is related to lovell/sharp#2373

In the sharp image service here

let result = sharp(inputBuffer, { failOnError: false, pages: -1 });
there is not away to add limitInputPixels: false to the sharp constructor.

What's the expected result?

I should be able to add limitInputPixels: false to the sharp constructor

Note: I can't upload the gif to the stackblitz editor, so the example below has the image link embedded directly in it. This does not work - you need to copy it locally.

The full gif can be found here: https://tomforb.es/visualizing-how-s3-deletes-1-billion-objects-with-athena-and-rust/animation_5.gif

Link to Minimal Reproducible Example

https://stackblitz.com/edit/github-arpawb?file=src%2Fpages%2Findex.astro

Participation

  • I am willing to submit a pull request for this issue.
@github-actions github-actions bot added the needs triage Issue needs to be triaged label Oct 22, 2023
@Princesseuh
Copy link
Member

Princesseuh commented Oct 23, 2023

I'd be okay with adding this to image.service.config somehow (maybe sharpImageService from astro/config could take a param to set a config), this is an easy enough and this has been a recurrent ask since the feature has been introduced.

@Princesseuh Princesseuh added - P2: nice to have Not breaking anything but nice to have (priority) help wanted Please help with this issue! feat: assets Related to the Assets feature (scope) and removed needs triage Issue needs to be triaged labels Oct 23, 2023
@DerTimonius
Copy link
Contributor

I would like to work on this, please 🙂

@lilnasy
Copy link
Contributor

lilnasy commented Oct 25, 2023

What do you think the API would look like?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
- P2: nice to have Not breaking anything but nice to have (priority) feat: assets Related to the Assets feature (scope) help wanted Please help with this issue!
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants