Closed bep closed 6 years ago
The Travis failures seem to be unrelated.
@bep The Travis issue is indeed unrelated to your changes. I'm in touch with their support, as it affects pretty much all of my projects currently.
Awesome, looks good to me. Thanks for the nice contribution! Do you plan to commit your alternative resizer as well, or do you want to keep it in your own repo / package? (I can see perfectly valid reasons doing it either way)
Looking forward to seeing this supported in Hugo!
Do you plan to commit your alternative resizer as well, or do you want to keep it in your own repo / package?
That wasn't the plan. Not sure how useful that is ...
That wasn't the plan. Not sure how useful that is ...
That said, if you want me to, I could do so, no problem.
@bep No, I think it's fine. It might still be useful to others, so maybe we should at least link to its source. I assume it's in a public repo anyway?
I assume it's in a public repo anyway?
Yes. https://github.com/gohugoio/hugo -- but it's still, for natural reasons, in pull request mode in that repo, too.
Yeah, we should point to that source once it's all merged on both sides. Speaking about it: I'm gonna click a little merge button here now. Thanks for the contribution again!
This commit adds a new
Resizer
interface with the resizer fromnfnt
as the default in its own package.This allows people to use the smartcrop library with their own resize implemention.
My motivation for this is to use this in Hugo. We use github.com/disintegration/imaging to do image processing -- github.com/nfnt/resize is probably equally good, but imaging had a richer API for the Hugo use cases.
I have tested this library and I'm really impressed by the results (and the speed):
http://hugotest.bep.is/resourcemeta/smartcrop/
The relevant Hugo PR is here:
https://github.com/gohugoio/hugo/pull/4376
I know this is breaking some API, but I think people are happy to adjust as long as it is for a greater good. And this is < 1.0 software, and it is super-easy to upgrade.
Again, tanks for this great piece of software.