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

@astrojs/image should support sharp crop strategies such as attention to find high entropy spots to center on #4341

Closed
1 task
jasikpark opened this issue Aug 15, 2022 · 2 comments · Fixed by #4438
Labels
pkg: image Related to the `@astrojs/image` package (scope)

Comments

@jasikpark
Copy link
Contributor

jasikpark commented Aug 15, 2022

What version of astro are you using?

1.0.5

Are you using an SSR adapter? If so, which one?

None

What package manager are you using?

npm

What operating system are you using?

Mac

Describe the Bug

astro-imagetools supported choosing the crop-strategy that sharp takes when cropping an image, https://sharp.pixelplumbing.com/api-resize#resize, which meant that an image of a lighthouse centered on the lighthouse, while now it simply naively cropped from the bottom and the right of the image, cutting off the lighthouse.

Original New

image

image

I realize that astro-imagetools is a community maintained library rather than a 1st party integration, but it'd be great to have feature parity to make migrating to @astrojs/image seamless

Link to Minimal Reproducible Example

https://codesandbox.io/s/astro-4341-9rp30y?file=/src/pages/index.astro

Participation

  • I am willing to submit a pull request for this issue.
@natemoo-re natemoo-re added the - P2: nice to have Not breaking anything but nice to have (priority) label Aug 16, 2022
@tony-sull tony-sull added pkg: image Related to the `@astrojs/image` package (scope) and removed - P2: nice to have Not breaking anything but nice to have (priority) labels Aug 24, 2022
@tony-sull
Copy link
Contributor

I think we're still a little early in the image integration to add more fine-grained image transformations like this. The plan right now is to keep the transformations with the built-in service pretty bare bones to avoid painting ourselves into a corner

We're actually hoping to swap sharp for Squoosh as the default image transformer soon to add support for web containers and Stackblitz.

Closing this as for now only because we need more time to hammer out the @astrojs/image API before committing to more complex transform options. 💯 agree it'd be nice to have this in the future though!

@brandondeweese-reify
Copy link

2 years later we still can't crop images. is this happening in the near future?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg: image Related to the `@astrojs/image` package (scope)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants