Fixed Build
This commit is contained in:
parent
99b67870a5
commit
3a7a04920d
9 changed files with 97 additions and 233 deletions
|
|
@ -150,23 +150,22 @@ public class ImageCreatorSharp
|
|||
{
|
||||
using (var img = SixLabors.ImageSharp.Image.Load(_workFile.FullName))
|
||||
{
|
||||
ExifReader.Orientations finalOrientation;
|
||||
var rotation = img.Metadata?.ExifProfile?.GetValue(ExifTag.Orientation);
|
||||
if (rotation == null)
|
||||
_orientation = ExifReader.Orientations.TopLeft;
|
||||
|
||||
IExifValue<ushort> rotation = null;
|
||||
|
||||
var found = img.Metadata?.ExifProfile?.TryGetValue(ExifTag.Orientation, out rotation) ?? false;
|
||||
|
||||
if (found)
|
||||
{
|
||||
finalOrientation = ExifReader.Orientations.TopLeft;
|
||||
}
|
||||
else
|
||||
{
|
||||
finalOrientation = (ExifReader.Orientations)rotation.Value;
|
||||
_orientation = (ExifReader.Orientations)rotation.ToInt32();
|
||||
}
|
||||
|
||||
_orientation = finalOrientation;
|
||||
|
||||
var creation = img.Metadata?.ExifProfile?.GetValue(ExifTag.DateTime);
|
||||
if (creation != null)
|
||||
IExifValue<string> date = null;
|
||||
var creationFound = img.Metadata?.ExifProfile?.TryGetValue(ExifTag.DateTime, out date) ?? false;
|
||||
if (creationFound)
|
||||
{
|
||||
var succ = DateTime.TryParse(creation.Value, out var crDate);
|
||||
var succ = DateTime.TryParse(date.ToString(), out var crDate);
|
||||
if (succ)
|
||||
{
|
||||
_creationDate = crDate;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue