|
@@ -30,10 +30,8 @@ public static class EXIFHelper
|
|
|
// 6 = 90 degrees
|
|
// 6 = 90 degrees
|
|
|
// 7 = 90 degrees, flipped
|
|
// 7 = 90 degrees, flipped
|
|
|
// 8 = 270 degrees, flipped
|
|
// 8 = 270 degrees, flipped
|
|
|
- public static EXIFOrientation GetImageOrientation(string filePath)
|
|
|
|
|
|
|
+ public static EXIFOrientation GetImageOrientation(MagickImage magickImage)
|
|
|
{
|
|
{
|
|
|
- using var magickImage = new MagickImage();
|
|
|
|
|
- magickImage.Ping(filePath);
|
|
|
|
|
var profile = magickImage.GetExifProfile();
|
|
var profile = magickImage.GetExifProfile();
|
|
|
|
|
|
|
|
var orientationValue = profile?.GetValue(ExifTag.Orientation);
|
|
var orientationValue = profile?.GetValue(ExifTag.Orientation);
|
|
@@ -56,6 +54,13 @@ public static class EXIFHelper
|
|
|
};
|
|
};
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ public static EXIFOrientation GetImageOrientation(string filePath)
|
|
|
|
|
+ {
|
|
|
|
|
+ using var magickImage = new MagickImage();
|
|
|
|
|
+ magickImage.Ping(filePath);
|
|
|
|
|
+ return GetImageOrientation(magickImage);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
public static EXIFOrientation GetImageOrientation(FileInfo fileInfo)
|
|
public static EXIFOrientation GetImageOrientation(FileInfo fileInfo)
|
|
|
{
|
|
{
|
|
|
return GetImageOrientation(fileInfo.FullName);
|
|
return GetImageOrientation(fileInfo.FullName);
|