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
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 12 deletions

View File

@ -42,7 +42,7 @@
<td><a href="@(ContentUrl(context.FileId))" target="_new">@context.Name</a></td> <td><a href="@(ContentUrl(context.FileId))" target="_new">@context.Name</a></td>
<td>@context.ModifiedOn</td> <td>@context.ModifiedOn</td>
<td>@context.Extension.ToUpper() @Localizer["File"]</td> <td>@context.Extension.ToUpper() @Localizer["File"]</td>
<td>@string.Format("{0:0.00}", ((decimal)context.Size / 1000)) KB</td> <td>@(context.Size / 1000) KB</td>
</Row> </Row>
</Pager> </Pager>
@if (_files.Count == 0) @if (_files.Count == 0)

View File

@ -535,9 +535,6 @@ namespace Oqtane.Controllers
file.ImageHeight = 0; file.ImageHeight = 0;
file.ImageWidth = 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); FileStream stream = new FileStream(filepath, FileMode.Open, FileAccess.Read);
@ -546,9 +543,9 @@ namespace Oqtane.Controllers
file.ImageHeight = image.Height; file.ImageHeight = image.Height;
file.ImageWidth = image.Width; file.ImageWidth = image.Width;
} }
stream.Close(); stream.Close();
} }
}
return file; return file;
} }