1

is it possible to change exif data from photos ? I get the exif data thus :

var directories = ImageMetadataReader.ReadMetadata(file);

foreach (var directory in directories)
{
    foreach (var tag in directory.Tags)
        Console.WriteLine($"[{directory.Name}] {tag.Name} = {tag.Description}");

    if (directory.HasError)
    {
        foreach (var error in directory.Errors)
            Console.WriteLine($"ERROR: {error}");
    }
}

Now I need to replace the exif data from other photos to these, is that possible ?

How to edit EXIF data in .NET - its not correct answer, because all this librarycant edit exif , just read

Lolidze
  • 219
  • 2
  • 13
  • [here is](https://stackoverflow.com/q/32066893/1132334) for one property. other writable properties should work the same way. – Cee McSharpface Sep 28 '17 at 19:38
  • @dlatikay I found this solution, but i have error `System.NullReferenceException` in line `string originalDateString = _Encoding.GetString(DataTakenProperty1.Value);` – Lolidze Sep 28 '17 at 19:49
  • @Jasen yes, i can read but how i can change exif ? gps, date, camera model and etc – Lolidze Sep 28 '17 at 19:53
  • The metadata you are asking about depends on the image type. Then jpg images in particular have different exif formats which may not all be encoded into the file. You might have some success with [`InPlaceBitmapMetadataWriter`](https://msdn.microsoft.com/en-us/library/system.windows.media.imaging.inplacebitmapmetadatawriter(v=vs.110).aspx). But this stuff can get complicated which is why there are so many 3rd party libraries to hide all the details. The one you are using doesn't appear to handle writing. – Jasen Sep 28 '17 at 20:11
  • @Jasen images is jpg. The photo is not passed through a third-party program, right from the camera. hidden values should not be – Lolidze Sep 28 '17 at 20:21
  • If you want to do it yourself you'd start here https://msdn.microsoft.com/en-us/library/system.windows.media.imaging.bitmapmetadata(v=vs.110).aspx – Jasen Sep 28 '17 at 21:53

1 Answers1

0

The metadata-extractor library doesn't support writing data back to files.

So the answer to your question is, unfortunately, no.

You will have to find a different method to modify data in your files.

Drew Noakes
  • 300,895
  • 165
  • 679
  • 742