0

I'm using imagesharp.web. Image width/height is reduced as expected, but size not reduced to fit for web applications(Size is more that 1 MB). I found that Exif data are there in the image contributing to this size.

Is there a way to remove Exif data from a image when we use Imagesharp.web?

1 Answers1

2

You can set the Metadata.ExifProfile property to null during OnBeforeSaveAsync

services.AddImageSharp(
    options => options.OnBeforeSaveAsync = f =>
    {
        f.Image.Metadata.ExifProfile = null;
        return Task.CompletedTask;
    });
James South
  • 10,147
  • 4
  • 59
  • 115