Browse Source

Clean up some EXIF documentation

af/merge-core
James Jackson-South 9 years ago
parent
commit
dfb702f5bf
  1. 9
      src/ImageSharp/Profiles/Exif/ExifProfile.cs
  2. 10
      src/ImageSharp/Profiles/Exif/ExifTagDescriptionAttribute.cs
  3. 24
      src/ImageSharp/Profiles/Exif/ExifWriter.cs

9
src/ImageSharp/Profiles/Exif/ExifProfile.cs

@ -117,6 +117,9 @@ namespace ImageSharp
/// </summary>
/// <typeparam name="TColor">The pixel format.</typeparam>
/// <typeparam name="TPacked">The packed format. <example>uint, long, float.</example></typeparam>
/// <returns>
/// The <see cref="Image{TColor,TPacked}"/>.
/// </returns>
public Image<TColor, TPacked> CreateThumbnail<TColor, TPacked>()
where TColor : struct, IPackedPixel<TPacked>
where TPacked : struct
@ -143,6 +146,9 @@ namespace ImageSharp
/// Returns the value with the specified tag.
/// </summary>
/// <param name="tag">The tag of the EXIF value.</param>
/// <returns>
/// The <see cref="ExifValue"/>.
/// </returns>
public ExifValue GetValue(ExifTag tag)
{
foreach (ExifValue exifValue in this.Values)
@ -160,6 +166,9 @@ namespace ImageSharp
/// Removes the value with the specified tag.
/// </summary>
/// <param name="tag">The tag of the EXIF value.</param>
/// <returns>
/// The <see cref="bool"/>.
/// </returns>
public bool RemoveValue(ExifTag tag)
{
this.InitializeValues();

10
src/ImageSharp/Profiles/Exif/ExifTagDescriptionAttribute.cs

@ -28,6 +28,14 @@ namespace ImageSharp
this.description = description;
}
/// <summary>
/// Gets the tag description from any custom attributes.
/// </summary>
/// <param name="tag">The tag.</param>
/// <param name="value">The value.</param>
/// <returns>
/// The <see cref="string"/>.
/// </returns>
public static string GetDescription(ExifTag tag, object value)
{
FieldInfo field = tag.GetType().GetTypeInfo().GetDeclaredField(tag.ToString());
@ -40,7 +48,7 @@ namespace ImageSharp
{
object attributeValue = customAttribute.ConstructorArguments[0].Value;
if (Equals(attributeValue, value))
if (object.Equals(attributeValue, value))
{
return (string)customAttribute.ConstructorArguments[1].Value;
}

24
src/ImageSharp/Profiles/Exif/ExifWriter.cs

@ -10,11 +10,20 @@ namespace ImageSharp
using System.Collections.ObjectModel;
using System.Text;
/// <summary>
/// Contains methods for writing EXIF metadata.
/// </summary>
internal sealed class ExifWriter
{
/// <summary>
/// The start index.
/// </summary>
private const int StartIndex = 6;
private static readonly ExifTag[] IfdTags = new ExifTag[127]
/// <summary>
/// The collection if Image File Directory tags
/// </summary>
private static readonly ExifTag[] IfdTags =
{
ExifTag.SubfileType,
ExifTag.OldSubfileType,
@ -145,7 +154,10 @@ namespace ImageSharp
ExifTag.GDALNoData
};
private static readonly ExifTag[] ExifTags = new ExifTag[92]
/// <summary>
/// The collection of Exif tags
/// </summary>
private static readonly ExifTag[] ExifTags =
{
ExifTag.ExposureTime,
ExifTag.FNumber,
@ -241,7 +253,10 @@ namespace ImageSharp
ExifTag.LensSerialNumber
};
private static readonly ExifTag[] GPSTags = new ExifTag[31]
/// <summary>
/// The collection of GPS tags
/// </summary>
private static readonly ExifTag[] GPSTags =
{
ExifTag.GPSVersionID,
ExifTag.GPSLatitudeRef,
@ -276,6 +291,9 @@ namespace ImageSharp
ExifTag.GPSDifferential
};
/// <summary>
/// Which parts will be written.
/// </summary>
private ExifParts allowedParts;
private Collection<ExifValue> values;
private Collection<int> dataOffsets;

Loading…
Cancel
Save