Skip to content

Conversation

@SilensAngelusNex
Copy link
Contributor

Add the description and created fields to ImageMetaResponse so that they will be accessible to callers of get_image_metadata.

Fixes #3053

Sanity check:

  • ✔️ Have you checked to ensure there aren't other open Pull Requests for the same update/change?

Code changes

  • ✔️ Are you doing the PR on the next branch?
  • ✔️ Have you created/updated the relevant documentation page(s)?

Include the file extension we're using, and make it clear that we're reading
metadata, not necessarily the image itself.
This way we won't have to parse multiple times when calling multiple helpers.
@SilensAngelusNex
Copy link
Contributor Author

SilensAngelusNex commented Dec 31, 2025

I made the type for created be String, but I'd really like to make it something more structured, like exif::DateTime (which can handle timezones and has sub-second resolution). I'm not really sure what the best way to define would be so that Tera can use it. Ideally, we'd still be able to compare it with < et al, but it seems like Tera doesn't support that so we'd have to provide comparison functions?

LMK if you think there's a better approach here.

@Keats
Copy link
Collaborator

Keats commented Jan 5, 2026

I'm not really sure what the best way to define would be so that Tera can use it. Ideally, we'd still be able to compare it with < et al, but it seems like Tera doesn't support that so we'd have to provide comparison functions?

Nope it's not possible, we would need to expose a specific type in the Value enum in Tera for datetimes, I considered it for tera2 but ended up not doing it because it adds lots of complexity to handle all the tz/various libraries. I will add some tests though, eg my_date is after(d=other_date), my_date is before(d=other_date). Not as nice as <, > but good enough

};

if bytes.len() == 0 {
eprintln!("String value for {:?} has empty Ascii vec.", tag);
Copy link
Collaborator

Choose a reason for hiding this comment

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

can we bubble those as errors so the user will know which image it's for?

Copy link
Collaborator

Choose a reason for hiding this comment

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

and is an empty value an error?

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.

2 participants