Skip to content

Commit

Permalink
Add quick start documentation to read me.
Browse files Browse the repository at this point in the history
  • Loading branch information
oozcitak committed Sep 6, 2019
1 parent dc73689 commit 2cd0650
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ExifLibrary/ExifProperty.cs
Original file line number Diff line number Diff line change
Expand Up @@ -647,7 +647,7 @@ public override ExifInterOperability Interoperability
}

/// <summary>
/// Represents a 16-bit signed integer. (EXIF Specification: SHORT)
/// Represents a 16-bit signed integer. (EXIF Specification: SSHORT)
/// </summary>
public class ExifSShort : ExifProperty
{
Expand Down Expand Up @@ -676,7 +676,7 @@ public override ExifInterOperability Interoperability

/// <summary>
/// Represents an array of 16-bit signed integers.
/// (EXIF Specification: SHORT with count > 1)
/// (EXIF Specification: SSHORT with count > 1)
/// </summary>
public class ExifSShortArray : ExifProperty
{
Expand Down
54 changes: 54 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,57 @@
[![AppVeyor](https://img.shields.io/appveyor/ci/oozcitak/exiflibrary.svg?style=flat-square)](https://ci.appveyor.com/project/oozcitak/exiflibrary)

ExifLibrary is a .Net Standard library for editing Exif metadata contained in image files.

# Installation #

If you are using [NuGet](https://nuget.org/) you can install the assembly with:

`PM> Install-Package ExifLibNet`

# Quick Start #

To read an image file and extract metadata:

```cs
var file = ImageFile.FromFile('path_to_image');
// metadata.Properties is a collection of image metadata
foreach (var item in file.Properties)
{
if (item.Tag == ExifTag.ISOSpeedRatings)
{
var isoTag = item as ExifUShort;
// the type of Value is unsigned short
// see documentation for tag data types
ushort iso = isoTag.Value;
}
else if (item.Tag == ExifTag.Flash)
{
var flashTag = item as ExifEnumProperty<Flash>;
// Value is an enum property
Flash flash = flashTag.Value;
}
else if (item.Tag == ExifTag.GPSLatitude)
{
var latTag = item as GPSLatitudeLongitude;
// Value contains three rational numbers
// representing degrees/minutes/seconds
// of the latitude
MathEx.UFraction32[] lat = latTag.Value;
}
}
```

To add metadata:

```cs
var file = ImageFile.FromFile('path_to_image');
file.Properties.Add(ExifTag.ISOSpeedRatings, 200);

```

To save the image with metadata:

```cs

file.Save('path_to_image');
```

0 comments on commit 2cd0650

Please sign in to comment.