#1120 Fix forUpload SVG throw error
This commit is contained in:
@ -538,10 +538,15 @@ namespace Oqtane.Controllers
|
|||||||
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);
|
FileStream stream = new FileStream(filepath, FileMode.Open, FileAccess.Read);
|
||||||
using (var image = Image.FromStream(stream))
|
|
||||||
{
|
//svg has no image and height, the attributes for svg are held in the XML viewport
|
||||||
file.ImageHeight = image.Height;
|
if(file.Extension != "svg")
|
||||||
file.ImageWidth = image.Width;
|
{
|
||||||
|
using (var image = Image.FromStream(stream))
|
||||||
|
{
|
||||||
|
file.ImageHeight = image.Height;
|
||||||
|
file.ImageWidth = image.Width;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
stream.Close();
|
stream.Close();
|
||||||
|
Reference in New Issue
Block a user