Search code examples
imageresizer

ImageResizer White Space Trimmer Crop Out of Bounds


We are using the WhiteSpaceTrimmer plugin to try and automatically trim down whitespace when it exists and add back some padding with the trim.percentpadding parameter. We are running all images through the white space trimmer, since we don't dynamically know if it exists or not.

We are running into an issue with some images and getting a "Crop rectangle is outside the bounds of the image" exception message.

Here is an example: https://imageresizer.furnituredealer.net/img/remote/images.furnituredealer.net/img/products%2Fsignature_design_by_ashley%2Fcolor%2Flamps%20-%20contemporary_l117914-b0.jpg?trim.threshold=50&trim.percentpadding=2

It seems we get this error only on portrait aspect ratio images.

I'm curious if there is something with our parameters wrong for portrait images, or something else we're missing. Or something else under the hood that we are not accounting for since we aren't calling any explicit crop.


Solution

  • This is a bug in ImageResizer; it has been reproduced and fixed.

    https://github.com/imazen/resizer/issues/215

    Updated binaries are available in the nightly feed, but it will be on NuGet.org in the next few days.