-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
feat(gatsby-transformer-sharp): add inside and outside fit options #13393
Conversation
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.
Could you provide a sample use case for this and/or project configured to use these options?
Here's a use case for
|
I'm thinking of moving Would love some feedback on this point. |
I think we will need to make more changes than just adding those options in transformer - it seems like |
Could you clarify what you mean by gatsby itself? Sharp is making the correct image sizes with |
I think I might misunderstood what |
Ok, I was actually correct (that's new :D): Input image here was 4823 x 7234 (~portraity aspect ratio). I've run sharp using all fit options and using square width/height for resize (570x570) the We calculate width/height (for fixed/resize) or aspectRatio (for fluid) in |
I think Both the width/height (for fixed/resize) or aspectRatio (for fluid) behave naturally, creating a "frame" around the image. While the image is a different aspect ratio, the "frame" is controlled by the respective input. We can make |
Hmm, but won't end result (if we don't change width/height and aspectRatio calcs) look exactly the same for |
Good point! Right now I was thinking of adding documentation to point this out because |
Hey @VGoose. Did you have any time to work more on this or do you think you will have time to finish this Pull Request? We would love to have this feature in. Let us know if you need any help with finishing this up 💜 💪 ! |
Hi @pieh, I recently got a new job and currently don't have the bandwidth to do this :(. It's something I really want to add but unfortunately I really can't commit to it right now. 💔 |
That's totally understandable - we appreciate effort you put in this and Your previous PRs 💜 💪. For now let's close the PR if you don't have bandwidth to work on this - we can always reopen it later on. |
I've been waiting for the PR to merge since April! What needs to be done to finish it? From your conversation, it sounds like it's just documentation changes that remain? Or were you planning on trying to pass the fit option from I'm happy to do the work to get this ready to merge, but I'd appreciate guidance from the two of you on the path we want to take! |
Hi @chris-hammond, from my last conversation with @pieh, we wanted to ship these options for all three methods. There are a few small issues but the main issue is that is blocking this (for me) is With |
Added `INSIDE` and `OUTSIDE` options for for gatsby-transformer-sharp. Here's a use case for inside [#13078 (comment)](#13078 (comment)). This includes changing gatsby-image to use `contain` instead of `cover` for object-fit, which does not affect the existing fit options. Updated documentation for gatsby-transformer-sharp to clarify the fit options and show that they are available for all three functions. NOTE: This is an extension of PR #13393 by @VGoose , which was closed because he didn't have time to complete the work. Co-authored-by: AnhVoMBP15 <[email protected]> Co-authored-by: soundguy66 <[email protected]> Co-authored-by: gatsbybot <[email protected]> Co-authored-by: Ward Peeters <[email protected]>
Description
Add
inside
andoutside
optionsRelated Issues
Addresses #12972