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

Switch from custom trim operation to vips_find_trim #914

Closed
fwang2002 opened this issue Aug 15, 2017 · 5 comments
Closed

Switch from custom trim operation to vips_find_trim #914

fwang2002 opened this issue Aug 15, 2017 · 5 comments

Comments

@fwang2002
Copy link

Is there any way to get crop offsets from the original image when use trim(). I mean not the original image in the pipe, but the nearest pipe item before trim.

@lovell
Copy link
Owner

lovell commented Aug 16, 2017

Hello, this is not at the moment. After libvips 8.6 is released we can switch from sharp's internal trim operation to libvips' forthcoming vips_find_trim operation, which will allow us to expose the calculated offsets.

@jcupitt
Copy link
Contributor

jcupitt commented Aug 20, 2017

Hello, vips keeps metadata fields xoffset / yoffset which record the position of the input image in the output image. For example:

john@kiwi:~/pics$ vips smartcrop k2.jpg x.v 500 500
john@kiwi:~/pics$ vipsheader -f xoffset x.v
-339
john@kiwi:~/pics$ vipsheader -f yoffset x.v
-1542

They should be valid after any kind of coordinate transform. They might be useful in this case.

@lovell lovell changed the title Any way to get offsets from original image for a trimmed image ? Switch from custom trim operation to vips_find_trim, requires libvips v8.6.0+ Oct 20, 2017
@lovell lovell removed this from the v0.19.0 milestone Jan 12, 2018
@ArmorDarks
Copy link

libvips 8.6 has been released. Are there any chances to get this feature?

@lovell
Copy link
Owner

lovell commented Mar 5, 2018

@ArmorDarks As always, happy to help with and accept a PR for this.

@lovell lovell changed the title Switch from custom trim operation to vips_find_trim, requires libvips v8.6.0+ Switch from custom trim operation to vips_find_trim Aug 4, 2018
@lovell lovell removed the help wanted label Oct 1, 2018
@lovell lovell added this to the v0.21.0 milestone Oct 1, 2018
@lovell
Copy link
Owner

lovell commented Oct 4, 2018

v0.21.0 now available with this change.

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

4 participants