Using a library based on ImageMagick Magick.NET in C # to add EXIF metadata to processed JPEG, which currently does not have an EXIF profile. Attempts to create a profile failed:
var newExifProfile = image.GetExifProfile();
if (newExifProfile == null)
{
newExifProfile = new ExifProfile();
}
newExifProfile.SetValue(ExifTag.Copyright, "test");
ExifProfilehas other constructors that accept a stream or a byte array, and not providing one throws an exception whenever it is called .SetValue():
Object reference not set to an instance of an object.
at ImageMagick.ExifReader.GetBytes(UInt32 length)
at ImageMagick.ExifReader.Read(Byte[] data)
at ImageMagick.ExifProfile.SetValue(ExifTag tag, Object value)
How to use Magick.NET to write EXIF data?
source
share