mirror of
https://github.com/wassname/scikit-image.git
synced 2026-08-16 10:34:50 +08:00
Fix and test 0-end bug in crop
This commit is contained in:
@@ -1530,7 +1530,7 @@ def crop(ar, crop_width, copy=False, order='K'):
|
||||
"""
|
||||
ar = np.array(ar, copy=False)
|
||||
crops = _validate_lengths(ar, crop_width)
|
||||
slices = tuple([slice(a, -b) for a, b in crops])
|
||||
slices = [slice(a, ar.shape[i] - b) for i, (a, b) in enumerate(crops)]
|
||||
if copy:
|
||||
cropped = np.copy(ar[slices], order=order)
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user