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

Retrieve coordinates from Entropy and Attention crop #868

Closed
miro-ux opened this issue Jul 10, 2017 · 5 comments
Closed

Retrieve coordinates from Entropy and Attention crop #868

miro-ux opened this issue Jul 10, 2017 · 5 comments

Comments

@miro-ux
Copy link

miro-ux commented Jul 10, 2017

Is there a way to get the coordinates used for the sharp.strategy.entropy or sharp.strategy.attention crop?

I want to be able to store the crop data to database as x,y,width,height so that I can generate a cropbox on the front-end to match the already cropped thumbnail when users try to manually adjust it crop. Right now I'm placing the cropbox in the center which is confusing because it doesn't match the current thumbnail. Here's what I want the cropbox to look like: (matching the entropy-based thumbnail)
2017-07-09_221622

@miro-ux miro-ux changed the title Retrieve Data from Entropy and Attention Crop Retrieve coordinates from Entropy and Attention crop Jul 10, 2017
@lovell
Copy link
Owner

lovell commented Jul 10, 2017

Hello, this was previously available (up to v0.17.x) in undocumented/unsupported properties in the info part of the output.

To provide this in a supported manner we'd need to expose the results from libvips' smartcrop operation (which used and improved upon some of the original sharp logic of the same name).

@lovell lovell added this to the v0.19.0 milestone Sep 13, 2017
@lovell
Copy link
Owner

lovell commented Oct 1, 2017

This will be in v0.19.0 - https://github.com/lovell/sharp/blob/suit/lib/output.js#L19

@homerjam
Copy link

Hey @lovell will cropOffsetLeft / cropOffsetTop be available using toBuffer() method?

Looking forward to v0.19.0!

@lovell
Copy link
Owner

lovell commented Nov 25, 2017

@homerjam Yes, I've updated the docs in commit 7067bed to make this clearer.

@lovell
Copy link
Owner

lovell commented Jan 12, 2018

sharp v0.19.0 now available.

@lovell lovell closed this as completed Jan 12, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants