diff --git a/src/ImageProcessor/Processors/EntropyCrop.cs b/src/ImageProcessor/Processors/EntropyCrop.cs index 142600f34..ad6812643 100644 --- a/src/ImageProcessor/Processors/EntropyCrop.cs +++ b/src/ImageProcessor/Processors/EntropyCrop.cs @@ -64,6 +64,7 @@ namespace ImageProcessor.Processors // Search for the first white pixels Rectangle rectangle = ImageMaths.GetFilteredBoundingRectangle(grey, 0); + grey.Dispose(); newImage = new Bitmap(rectangle.Width, rectangle.Height); newImage.SetResolution(image.HorizontalResolution, image.VerticalResolution); @@ -80,7 +81,6 @@ namespace ImageProcessor.Processors } // Reassign the image. - grey.Dispose(); image.Dispose(); image = newImage; }