mirror of
https://github.com/ShareX/ShareX.git
synced 2024-10-01 17:56:51 +13:00
Check file path before get absolute path
This commit is contained in:
parent
3e6cf489e5
commit
6f29d7ee67
1 changed files with 11 additions and 8 deletions
|
@ -1548,18 +1548,21 @@ public static Image LoadImage(string filePath)
|
|||
{
|
||||
try
|
||||
{
|
||||
filePath = Helpers.GetAbsolutePath(filePath);
|
||||
|
||||
if (!string.IsNullOrEmpty(filePath) && Helpers.IsImageFile(filePath) && File.Exists(filePath))
|
||||
if (!string.IsNullOrEmpty(filePath))
|
||||
{
|
||||
Image img = Image.FromStream(new MemoryStream(File.ReadAllBytes(filePath)));
|
||||
filePath = Helpers.GetAbsolutePath(filePath);
|
||||
|
||||
if (HelpersOptions.RotateImageByExifOrientationData)
|
||||
if (!string.IsNullOrEmpty(filePath) && Helpers.IsImageFile(filePath) && File.Exists(filePath))
|
||||
{
|
||||
RotateImageByExifOrientationData(img);
|
||||
}
|
||||
Image img = Image.FromStream(new MemoryStream(File.ReadAllBytes(filePath)));
|
||||
|
||||
return img;
|
||||
if (HelpersOptions.RotateImageByExifOrientationData)
|
||||
{
|
||||
RotateImageByExifOrientationData(img);
|
||||
}
|
||||
|
||||
return img;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
|
|
Loading…
Reference in a new issue