Skip to content

Instantly share code, notes, and snippets.

@bleroy
Created January 18, 2017 18:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bleroy/448ee814d2aa2077af2a522f58ec8746 to your computer and use it in GitHub Desktop.
Save bleroy/448ee814d2aa2077af2a522f58ec8746 to your computer and use it in GitHub Desktop.
var exif = image.ExifProfile;
var description = exif.GetValue(ImageSharpExifTag.ImageDescription);
var yearTaken = DateTime.ParseExact(
(string)exif.GetValue(ImageSharpExifTag.DateTimeOriginal).Value,
"yyyy:MM:dd HH:mm:ss",
CultureInfo.InvariantCulture)
.Year;
var author = exif.GetValue(ImageSharpExifTag.Artist);
var copyright = $"{description} (c) {yearTaken} {author}";
exif.SetValue(ImageSharpExifTag.Copyright, copyright);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment