Search code examples
imagesharp

Imagesharp - prevent from resizing small images


Is it possible to prevent Imagesharp from resizing images if their dimensions are smaller than those specified in the query parameters?


Solution

  • If you mean ImageSharp.Web then yes.

    You would have to replace the default ResizeWebProcessor with an updated version of Process(FormattedImage image, ILogger logger, IDictionary<string, string> commands) that first checks the size parsed from the command against the input image.