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

Support for focal point (crop/background position) #21

Open
JiveDig opened this issue Feb 2, 2020 · 1 comment
Open

Support for focal point (crop/background position) #21

JiveDig opened this issue Feb 2, 2020 · 1 comment

Comments

@JiveDig
Copy link

JiveDig commented Feb 2, 2020

First off, thanks for this library, it seems extremely useful!

When generating images to be used as a background image (Cover Block, etc) there are 2 requirements in order to use this library:

  1. Allow different aspect ratios at different window sizes (pretty sure this already works).

  2. Allow a focal point so different sizes are cropped in the correct location.

Since the block editor now has and uses this
https://developer.wordpress.org/block-editor/components/focal-point-picker/ It would be super useful to be able to pass the focal point (in relation to the original image) and have the additional image sizes use this focal point when generating new images.

Maybe there is a better solution, but either way it would be great to insure the focal point is always centered on all the images.

@JiveDig
Copy link
Author

JiveDig commented Feb 2, 2020

Looking into WP_Image_Editor class, it seems like crop() method handles this pretty well. Maybe this could be integrated here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant