Skip to content

Commit

Permalink
Merge pull request #56 from hgy59/gpsversion_only
Browse files Browse the repository at this point in the history
Gpsversion fixed
  • Loading branch information
oozcitak authored Jun 22, 2018
2 parents 9713d45 + 94ed442 commit 9351f3d
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 2 deletions.
24 changes: 23 additions & 1 deletion ExifLibrary/ExifExtendedProperty.cs
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ public override ExifInterOperability Interoperability

/// <summary>
/// Represents the exif version as a 4 byte ASCII string. (EXIF Specification: UNDEFINED)
/// Used for the ExifVersion, FlashpixVersion, InteroperabilityVersion and GPSVersionID fields.
/// Used for the ExifVersion, FlashpixVersion and InteroperabilityVersion fields.
/// </summary>
public class ExifVersion : ExifProperty
{
Expand Down Expand Up @@ -189,6 +189,28 @@ public override ExifInterOperability Interoperability
}
}

/// <summary>
/// Represents a version as a 4 byte byte array. (Specification: int8u[4])
/// Used for the GPSVersionID field.
/// </summary>
public class VersionID : ExifByteArray
{
public VersionID(ExifTag tag, byte [] value)
: base(tag, value)
{
}

public override string ToString()
{
StringBuilder sb = new StringBuilder();
foreach (var b in Value)
{
sb.Append(b).Append('.');
}
return sb.ToString().TrimEnd('.');
}
}

/// <summary>
/// Represents the location and area of the subject (EXIF Specification: 2xSHORT)
/// The coordinate values, width, and height are expressed in relation to the
Expand Down
2 changes: 1 addition & 1 deletion ExifLibrary/ExifPropertyFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ public static ExifProperty Get(ushort tag, ushort type, uint count, byte[] value
else if (ifd == IFD.GPS)
{
if (tag == 0) // GPSVersionID
return new ExifVersion(ExifTag.GPSVersionID, ExifBitConverter.ToString(value));
return new VersionID(ExifTag.GPSVersionID, value);
else if (tag == 1) // GPSLatitudeRef
return new ExifEnumProperty<GPSLatitudeRef>(ExifTag.GPSLatitudeRef, (GPSLatitudeRef)value[0]);
else if (tag == 2) // GPSLatitude
Expand Down

0 comments on commit 9351f3d

Please sign in to comment.