Revert "Fix Upload SVG throw error #1120"

This commit is contained in:
Shaun Walker
2021-02-24 17:26:54 -05:00
committed by GitHub
parent f60c60ac1d
commit eda2a5637f
2 changed files with 9 additions and 12 deletions

View File

@ -535,19 +535,16 @@ namespace Oqtane.Controllers
file.ImageHeight = 0;
file.ImageWidth = 0;
//svg has no image and height, the attributes for svg are held in the XML viewport
if(file.Extension != "svg")
{
if (Constants.ImageFiles.Split(',').Contains(file.Extension.ToLower()))
if (Constants.ImageFiles.Split(',').Contains(file.Extension.ToLower()))
{
FileStream stream = new FileStream(filepath, FileMode.Open, FileAccess.Read);
using (var image = Image.FromStream(stream))
{
FileStream stream = new FileStream(filepath, FileMode.Open, FileAccess.Read);
using (var image = Image.FromStream(stream))
{
file.ImageHeight = image.Height;
file.ImageWidth = image.Width;
}
stream.Close();
file.ImageHeight = image.Height;
file.ImageWidth = image.Width;
}
stream.Close();
}
return file;