I tried to install Magick.NET, I installed using dotnet add package Magick.NET-Q8-x64 --version 7.21.1
that I got from https://www.nuget.org/packages/Magick.NET-Q8-x64/
I tried running a few lines of code that I got from https://stackoverflow.com/a/31829105/13924025 :
public string UploadFile(string fileName, IFormFile file)
{
string extension = System.IO.Path.GetExtension(file.FileName);
string newFileName = "";
if (fileName == null)
{
// newFileName = Guid.NewGuid ().ToString () + "-" + file.FileName;
newFileName = Guid.NewGuid().ToString() + extension;
}
else
{
newFileName = Guid.NewGuid().ToString() + "-" + fileName + extension;
}
string filePath = "./Files/" + newFileName;
using (MagickImage image = new MagickImage(file))
{
image.Scale(new Percentage(60));
image.Write(filePath);
}
return newFileName;
}
But I get an error "The type or namespace name 'MagickImage' could not be found". Are there any suggestions for resolving this?