diff --git a/ElFinder.Net/ElFinder.Net/Facade/Root.cs b/ElFinder.Net/ElFinder.Net/Facade/Root.cs index 51a3f50..490ce66 100644 --- a/ElFinder.Net/ElFinder.Net/Facade/Root.cs +++ b/ElFinder.Net/ElFinder.Net/Facade/Root.cs @@ -248,10 +248,14 @@ internal Size GetImageDimension(FileInfo input) { if (!input.Exists) throw new ArgumentException("File not exist"); - using (Image image = Image.FromFile(input.FullName)) + try { - return new Size(image.Width, image.Height); - } + using (Image image = Image.FromFile(input.FullName)) + { + return new Size(image.Width, image.Height); + } + } catch {} + return new Size(0,0); } internal bool CanCreateThumbnail(FileInfo input) @@ -373,4 +377,4 @@ private string GenerateThumbPath(FileInfo originalImage) private IPicturesEditor _picturesEditor; #endregion } -} \ No newline at end of file +}