-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Add limitInputPixels option for sharp image service #9546
Merged
Merged
Changes from 3 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
1430af1
Add limitInputPixels option for sharp image service
bluwy 57b7bf5
Merge branch 'main' into sharp-limit-input-pixels
bluwy 15c8980
Fix types
bluwy f381c90
Merge branch 'main' into sharp-limit-input-pixels
ematipico a335361
Merge branch 'main' into sharp-limit-input-pixels
bluwy 5cc9007
Update docs
bluwy 90fc981
Merge branch 'main' into sharp-limit-input-pixels
ematipico b316915
Merge branch 'main' into sharp-limit-input-pixels
ematipico File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'astro': minor | ||
--- | ||
|
||
Adds `limitInputPixels` option for the Sharp image service to be passed on to Sharp. | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(I'm assuming this is a config-wide option set, and not e.g. per-image.)
Depending on the appropriate code sample here, the same will need to be added to the astro types file. Since sharp is the default image service, someone might not have this in their config already, but they'd need to add it in order to pass the option. So, I'm thinking somewhere here: https://docs.astro.build/en/reference/configuration-reference/#imageservice but it would have to account for the fact that someone is only adding this NOT to actually change the image service used, but rather to configure the default one. (Since, this option is JUST for Sharp, and not the other services)
Depending on whatever's decided here, for an actual docs PR, we can even get away with just linking to the config option from here: https://docs.astro.build/en/guides/images/#default-image-service and don't need to explain it. We really should have a link there anyway! 😅
Sorry this requires a bit of figuring out, but I'll make sure I get up early tomorrow and am happy to help with it!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the review! Yeah I have a rough idea to improve this now.
Thanks for linking me to the docs. I actually would've documented something like:
But I think it's easier to keep the object format for now, so it applies more generally to other kinds of image services.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've updated the changesets and jsdoc. Let me know what you think!