Skip to content

Conversation

1c3t3a
Copy link
Contributor

@1c3t3a 1c3t3a commented Sep 22, 2025

This change adds an iptc_metadata method (similar to xmp_metadata and exif_metadata) to the ImageDecoder and implements it for PNG and JPG.

This is related to #2610. If my research was correct and IPTC metadata only exists in PNG and JPG, then this should fix the issue.

This change adds an `iptc_metadata` method (similar to `xmp_metadata` and
`exif_metadata`) to the `ImageDecoder` and implements it for PNG and JPG.
@1c3t3a

This comment was marked as outdated.

@1c3t3a 1c3t3a changed the title Expose IPTC metadata for PNG and JPG Expose IPTC metadata for PNG, JPG and Tiff Sep 22, 2025
Comment on lines +540 to +545
/// This method converts a `Value` to a vector of bytes. A `Value` in Tiff can have different
/// types, e.g. a byte, a short or a float. This method intents to convert all these types to
/// a vector of bytes (e.g. a u32 can be represented as a [u8; 4]). However, since this is only
/// intended to parse values stored in XMP, IPTC and EXIF metadata sections, we ignore / return
/// an error on a few Values that don't make sense in this context (e.g. Value::Ifd).
fn value_to_bytes(value: Value, bytes: &mut Vec<u8>) -> ImageResult<()> {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know that this is most likely not ideal. There is a discussion between me an @197g here, where Aurelia points out how to archieve this properly as part of the Tiff crate.

I put this change into a separate commit and I can drop it here and get to first do it properly in tiff, if that is requested.

@1c3t3a
Copy link
Contributor Author

1c3t3a commented Sep 22, 2025

The CI failure seems to be due to a spurious network failure in a setup step. Is there a way to retrigger the run?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant