RedCorners.ExifLibrary 2.0.0

Easy reading and writing GPS coordinates. RedCorners.ExifLibrary allows you to read and modify EXIF properties of image files. This project is a .NET Standard port of ExifLibrary by oozcitak.

Install-Package RedCorners.ExifLibrary -Version 2.0.0
dotnet add package RedCorners.ExifLibrary --version 2.0.0
<PackageReference Include="RedCorners.ExifLibrary" Version="2.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add RedCorners.ExifLibrary --version 2.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

NuGet

https://www.nuget.org/packages/RedCorners.ExifLibrary

RedCorners.ExifLibrary

RedCorners.ExifLibrary is a .NET Standard port of ExifLibrary by oozcitak. The original project can be found here, which is under MIT License.

This fork adds extensions to write and read GPS coordinates with one function call, and as floating point values.

Original documentation can be found here.

Easy Reading of GPS Coordinates

using RedCorners.ExifLibrary;
var file = ImageFile.FromFile(Path);
var coords = file.GetGPSCoords();
if (coords.HasValue)
    (Latitude, Longitude) = coords.Value;

Easy Writing of GPS Coordinates

using RedCorners.ExifLibrary;
var file = ImageFile.FromFile(Path);
file.SetGPSCoords(Latitude, Longitude);
file.Save(Path);

Low Level Modification of EXIF Properties

try
{
    var file = ImageFile.FromFile(Path);

    var objLat = GPSLatitudeLongitude.FromFloat(Latitude);
    var objLng = GPSLatitudeLongitude.FromFloat(Longitude);

    file.Properties.Set(ExifTag.GPSLatitude, objLat.d, objLat.m, objLat.s);
    file.Properties.Set(ExifTag.GPSLongitude, objLng.d, objLng.m, objLng.s);

    file.Save(Path);

    MessageBox.Show("File saved.");
}
catch (Exception ex)
{
    MessageBox.Show(ex.ToString());
}

Low Level Reading of EXIF Properties

try
{
    var file = ImageFile.FromFile(Path);

    var objLat = file.Properties[ExifTag.GPSLatitude] as GPSLatitudeLongitude;
    var objLng = file.Properties[ExifTag.GPSLongitude] as GPSLatitudeLongitude;

    Latitude = objLat?.ToFloat() ?? 0;
    Longitude = objLng?.ToFloat() ?? 0;
}
catch (Exception ex)
{
    MessageBox.Show(ex.ToString());
}
RaisePropertyChanged(nameof(Latitude));
RaisePropertyChanged(nameof(Longitude));

NuGet

https://www.nuget.org/packages/RedCorners.ExifLibrary

RedCorners.ExifLibrary

RedCorners.ExifLibrary is a .NET Standard port of ExifLibrary by oozcitak. The original project can be found here, which is under MIT License.

This fork adds extensions to write and read GPS coordinates with one function call, and as floating point values.

Original documentation can be found here.

Easy Reading of GPS Coordinates

using RedCorners.ExifLibrary;
var file = ImageFile.FromFile(Path);
var coords = file.GetGPSCoords();
if (coords.HasValue)
    (Latitude, Longitude) = coords.Value;

Easy Writing of GPS Coordinates

using RedCorners.ExifLibrary;
var file = ImageFile.FromFile(Path);
file.SetGPSCoords(Latitude, Longitude);
file.Save(Path);

Low Level Modification of EXIF Properties

try
{
    var file = ImageFile.FromFile(Path);

    var objLat = GPSLatitudeLongitude.FromFloat(Latitude);
    var objLng = GPSLatitudeLongitude.FromFloat(Longitude);

    file.Properties.Set(ExifTag.GPSLatitude, objLat.d, objLat.m, objLat.s);
    file.Properties.Set(ExifTag.GPSLongitude, objLng.d, objLng.m, objLng.s);

    file.Save(Path);

    MessageBox.Show("File saved.");
}
catch (Exception ex)
{
    MessageBox.Show(ex.ToString());
}

Low Level Reading of EXIF Properties

try
{
    var file = ImageFile.FromFile(Path);

    var objLat = file.Properties[ExifTag.GPSLatitude] as GPSLatitudeLongitude;
    var objLng = file.Properties[ExifTag.GPSLongitude] as GPSLatitudeLongitude;

    Latitude = objLat?.ToFloat() ?? 0;
    Longitude = objLng?.ToFloat() ?? 0;
}
catch (Exception ex)
{
    MessageBox.Show(ex.ToString());
}
RaisePropertyChanged(nameof(Latitude));
RaisePropertyChanged(nameof(Longitude));

Release Notes

Easy reading and writing GPS coordinates. Access and modify EXIF records of image files.

  • .NETStandard 2.0

    • No dependencies.

This package is not used by any popular GitHub repositories.

Version History

Version Downloads Last updated
2.0.0 23 11/15/2019
1.0.1 199 4/18/2019
1.0.0 95 4/18/2019