ResizeRight icon indicating copy to clipboard operation
ResizeRight copied to clipboard

Numpy path broken with negative padding

Open harskish opened this issue 1 year ago • 0 comments

The function fw_pad is supposed to perform a crop when called with negative padding values.

However, the numpy codepath raises a ValueError if np.pad() is called with negative values. Specifically, np.pad calls _as_pairs(..., as_index=True) (link) internally which results in the error here.

I have patched the function in my fork, but I'm not sure if my fix is the most elegant.

harskish avatar Oct 06 '22 02:10 harskish