0

I am working in a .NET 6 application. I am already aware of the following answer, but I was looking for a solution where I wouldn't have to install .dll and manually include it in my project.

That answer is from 2019, and I was wondering if there's a better, easier way of converting a .jpg or .png to .webp.

The user is uploading an image file IFormFile and I am using ImageSharp to process the image (e.g. re-size it ...etc)

Image standardImage = Image.Load(file.OpenReadStream());
standardImage.Mutate(x => x.Resize(300, 300));

Before uploading the image to S3, I want to convert it to .webp. Is there a better way than the answer linked above?

J86
  • 14,345
  • 47
  • 130
  • 228
  • 1
    This should help https://blog.elmah.io/convert-images-to-webp-with-asp-net-core-better-than-png-jpg-files/ – Amit Kumar Jan 20 '22 at 10:22
  • This is still the same question, which is already answered. If the answers don't suit your needs, add a bounty asking for a better answer - you have plenty of reputation to use. Also, as it is, this is just a recommendation request, which is off-topic as you should know – Camilo Terevinto Jan 20 '22 at 10:29
  • 1
    My bad @CamiloTerevinto. Apologies, I'll do better next time. Thank you. – J86 Jan 20 '22 at 10:30
  • ImageSharp V2 will support WebP. Format support is already available in development builds. – James South Jan 25 '22 at 06:12

0 Answers0