I have an uploade controller that can save image to file and get thumbnail image from the file uploaded. it's working with .jpeg or .png but how can i get thumbnail image from webp extension and save it as .webp too. i got error parameter is not valid
uploadImage(IFormFile file){
....
Stream filestream = new FileStream(filePath, FileMode.Create);
await file.CopyToAsync(filestream);
var myBitmap = Image.FromStream(filestream); <----- error: parameter is not valid
using (var myThumbnail = myBitmap.GetThumbnailImage(150, 150, () => false, IntPtr.Zero))
{
//e.Graphics.DrawImage(myThumbnail, 150, 75); // scale main image if thum is big
size like 300 * 300
myThumbnail.Save(thumbFullPathName);
}
filestream.Close();
....
}
question from:https://stackoverflow.com/questions/66066474/get-thumbnail-from-webp-image-net-core-3-1