Adding New IptcProfile to PNG file #3046
-
|
This code successfully adds keywords to an existing IptcProfile in a jpg file, but fails to add keywords to a PNG file which doesn't already contain an IptcProfile. Is there some additional initialization that needs to be done on a new IptcProfile? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
|
I’ll have a look. The process code should be the same. |
Beta Was this translation helpful? Give feedback.
-
|
I've been wandering through a cloned version of ImageSharp in my solution and think I may have learned some things that bear on this question. The IptcProfile property of the ImageMetadata class appears to only be set for JPG files (the logic is part of the JpegDecoderCore class). I've seen this in action when dealing with JPG files in my app...and if it never gets initialized for other image types, that would explain part of what I'm seeing. I also noticed the Encode() method in PngEncoderCore does not have a call to store Iptc data: but it does reference WriteTextChunks(). Is it possible to store the Iptc subject data in the pngMetadata and have that show up as Iptc metadata? |
Beta Was this translation helpful? Give feedback.

Yes. PNG doesn't support it.... yet. However, I am writing support for decoding and encoding the information right now.
In my research I discovered this snippet
https://dev.exiv2.org/projects/exiv2/wiki/The_Metadata_in_PNG_files
I think ImageSharp will probably do the same. I'm fairly certain Magick.NET does also.
Btw do you have any PNG files containing IPTC data I could test the decoder with?