Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to extract IPTC metadata from PNG files? #673

Open
drewnoakes opened this issue Jul 24, 2024 Discussed in #672 · 2 comments
Open

How to extract IPTC metadata from PNG files? #673

drewnoakes opened this issue Jul 24, 2024 Discussed in #672 · 2 comments
Labels
format-iptc format-png good-first-issue An easy task suited to people new to the project and code help wanted image-queue Actionable issue with sample image

Comments

@drewnoakes
Copy link
Owner

Discussed in #672

Originally posted by dhoffer July 17, 2024
This is what is returned.

Raw profile type iptc:
IPTC profile
36
3842494d04040000000000181c0219000c74657374312c2074657374321c020000020004

So how can I decode this to get the actual metadata tags? My understanding (limited) is that these are stored in Photoshop metadata format inside the PNG.

The actual metadata of the above as reported by exiftool.

Keywords: test1, test2

How can I decode the same with metadata-extractor?

@drewnoakes drewnoakes added help wanted format-iptc format-png image-queue Actionable issue with sample image good-first-issue An easy task suited to people new to the project and code labels Jul 24, 2024
@drewnoakes
Copy link
Owner Author

Sample image provided by @dhoffer:

Standard_withKeywords

@StefanOltmann
Copy link
Contributor

Hi @drewnoakes,

It’s a hex string that just needs to be decoded back to a byte array.

I solved that in my library like this:
https://github.com/Ashampoo/kim/blob/83150150ea9e0e0aad637de72dbbf6b271cac7c2/src/commonMain/kotlin/com/ashampoo/kim/format/png/PngImageParser.kt#L166

Kind regards,

Stefan

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
format-iptc format-png good-first-issue An easy task suited to people new to the project and code help wanted image-queue Actionable issue with sample image
Projects
None yet
Development

No branches or pull requests

2 participants