I have to modify the iptc metadata of 6000+ jpg images. Unfortunately, I didn't found any library or even an example for doing so.
Could you please give me a hint how to modify the metadata of images or point me to a site where I can inform myself?
I have to modify the iptc metadata of 6000+ jpg images. Unfortunately, I didn't found any library or even an example for doing so.
Could you please give me a hint how to modify the metadata of images or point me to a site where I can inform myself?
A quick glance at the System.Windows.Media.Imaging namespace revealed the InPlaceBitmapMetadaWriter
class. I think this is what you're looking for:
Stream pngStream = new System.IO.FileStream("smiley.png", FileMode.Open, FileAccess.ReadWrite, FileShare.ReadWrite);
PngBitmapDecoder pngDecoder = new PngBitmapDecoder(pngStream, BitmapCreateOptions.PreservePixelFormat, BitmapCacheOption.Default);
BitmapFrame pngFrame = pngDecoder.Frames[0];
InPlaceBitmapMetadataWriter pngInplace = pngFrame.CreateInPlaceBitmapMetadataWriter();
if (pngInplace.TrySave() == true)
{
pngInplace.SetQuery("/Text/Description", "Have a nice day.");
}
pngStream.Close();