mirror of https://github.com/SixLabors/ImageSharp
12 changed files with 442 additions and 20 deletions
@ -0,0 +1,53 @@ |
|||||
|
// Copyright (c) Six Labors.
|
||||
|
// Licensed under the Apache License, Version 2.0.
|
||||
|
|
||||
|
using System.Globalization; |
||||
|
|
||||
|
namespace SixLabors.ImageSharp.Metadata.Profiles.Exif |
||||
|
{ |
||||
|
internal sealed class ExifLong8 : ExifValue<ulong> |
||||
|
{ |
||||
|
public ExifLong8(ExifTag<ulong> tag) |
||||
|
: base(tag) |
||||
|
{ |
||||
|
} |
||||
|
|
||||
|
public ExifLong8(ExifTagValue tag) |
||||
|
: base(tag) |
||||
|
{ |
||||
|
} |
||||
|
|
||||
|
private ExifLong8(ExifLong8 value) |
||||
|
: base(value) |
||||
|
{ |
||||
|
} |
||||
|
|
||||
|
public override ExifDataType DataType => ExifDataType.Long8; |
||||
|
|
||||
|
protected override string StringValue => this.Value.ToString(CultureInfo.InvariantCulture); |
||||
|
|
||||
|
public override bool TrySetValue(object value) |
||||
|
{ |
||||
|
if (base.TrySetValue(value)) |
||||
|
{ |
||||
|
return true; |
||||
|
} |
||||
|
|
||||
|
switch (value) |
||||
|
{ |
||||
|
case long intValue: |
||||
|
if (intValue >= 0) |
||||
|
{ |
||||
|
this.Value = (ulong)intValue; |
||||
|
return true; |
||||
|
} |
||||
|
|
||||
|
return false; |
||||
|
default: |
||||
|
return false; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
public override IExifValue DeepClone() => new ExifLong8(this); |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,27 @@ |
|||||
|
// Copyright (c) Six Labors.
|
||||
|
// Licensed under the Apache License, Version 2.0.
|
||||
|
|
||||
|
namespace SixLabors.ImageSharp.Metadata.Profiles.Exif |
||||
|
{ |
||||
|
internal sealed class ExifLong8Array : ExifArrayValue<ulong> |
||||
|
{ |
||||
|
public ExifLong8Array(ExifTag<ulong[]> tag) |
||||
|
: base(tag) |
||||
|
{ |
||||
|
} |
||||
|
|
||||
|
public ExifLong8Array(ExifTagValue tag) |
||||
|
: base(tag) |
||||
|
{ |
||||
|
} |
||||
|
|
||||
|
private ExifLong8Array(ExifLong8Array value) |
||||
|
: base(value) |
||||
|
{ |
||||
|
} |
||||
|
|
||||
|
public override ExifDataType DataType => ExifDataType.Long8; |
||||
|
|
||||
|
public override IExifValue DeepClone() => new ExifLong8Array(this); |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,26 @@ |
|||||
|
// Copyright (c) Six Labors.
|
||||
|
// Licensed under the Apache License, Version 2.0.
|
||||
|
|
||||
|
using System.Globalization; |
||||
|
|
||||
|
namespace SixLabors.ImageSharp.Metadata.Profiles.Exif |
||||
|
{ |
||||
|
internal sealed class ExifSignedLong8 : ExifValue<long> |
||||
|
{ |
||||
|
public ExifSignedLong8(ExifTagValue tag) |
||||
|
: base(tag) |
||||
|
{ |
||||
|
} |
||||
|
|
||||
|
private ExifSignedLong8(ExifSignedLong8 value) |
||||
|
: base(value) |
||||
|
{ |
||||
|
} |
||||
|
|
||||
|
public override ExifDataType DataType => ExifDataType.SignedLong8; |
||||
|
|
||||
|
protected override string StringValue => this.Value.ToString(CultureInfo.InvariantCulture); |
||||
|
|
||||
|
public override IExifValue DeepClone() => new ExifSignedLong8(this); |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,22 @@ |
|||||
|
// Copyright (c) Six Labors.
|
||||
|
// Licensed under the Apache License, Version 2.0.
|
||||
|
|
||||
|
namespace SixLabors.ImageSharp.Metadata.Profiles.Exif |
||||
|
{ |
||||
|
internal sealed class ExifSignedLong8Array : ExifArrayValue<long> |
||||
|
{ |
||||
|
public ExifSignedLong8Array(ExifTagValue tag) |
||||
|
: base(tag) |
||||
|
{ |
||||
|
} |
||||
|
|
||||
|
private ExifSignedLong8Array(ExifSignedLong8Array value) |
||||
|
: base(value) |
||||
|
{ |
||||
|
} |
||||
|
|
||||
|
public override ExifDataType DataType => ExifDataType.SignedLong8; |
||||
|
|
||||
|
public override IExifValue DeepClone() => new ExifSignedLong8Array(this); |
||||
|
} |
||||
|
} |
||||
Loading…
Reference in new issue