sharp icon indicating copy to clipboard operation
sharp copied to clipboard

extract: add option to treat width and height as "maximum" rather than absolute values

Open Alexufo opened this issue 4 years ago • 2 comments

If we try to extract more pixels than has an image - we will get "extract_area: bad extract area"

Can we ignore exception and extract an actual pixels? I don't want calculate if image.width < etc.. i suppose it should be in a core. May be additional option?

Alexufo avatar Oct 07 '19 00:10 Alexufo

Good idea, we should improve the error handling at the same time to avoid making any calls into libvips that could generate the dread "bad extract area" error.

Happy to accept a PR if you're able.

lovell avatar Oct 07 '19 14:10 lovell

A detailed error message would also help

oliviertassinari avatar Mar 04 '20 11:03 oliviertassinari