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

Implement a poor man's exrheader #235

Open
stevenparkerco3 opened this issue Jun 27, 2024 · 3 comments
Open

Implement a poor man's exrheader #235

stevenparkerco3 opened this issue Jun 27, 2024 · 3 comments
Labels
enhancement New feature or request

Comments

@stevenparkerco3
Copy link

What can be improved or is missing?

To help expand on the example applications, it would be great to have an example application which can output EXR Header information in the same/similar format to OpenEXR's exrheader application. I believe this would help developers explore the exrs API's a bit further and lower the barrier to entry. In line with what OpenImageIO calls their "Poor man's exrheader" tool using iinfo, it would be nice to have a similar example in exrs.

Implementation Approach

I'm still learning Rust, and pretty terrible at it, but have the following Gist which is semi-functional:
https://gist.github.com/stevenparkerco3/d49b21072670312443521931eb698e46

@stevenparkerco3 stevenparkerco3 added the enhancement New feature or request label Jun 27, 2024
@johannesvollmer
Copy link
Owner

johannesvollmer commented Jun 28, 2024

Yes, we also thought this might be useful. We planned to publish some simple tools similar to this as real binary creates, such that everyone can install them.

Unfortunately, no one had the time to actually do it. Feel free to proceed.

@johannesvollmer
Copy link
Owner

johannesvollmer commented Jun 28, 2024

  • Are there some specific improvements in the library that would make your task easier?
  • Do you want to 100% precisely replicate the OpenEXR output, or do you want to make a better one?

Here are more thoughts on your current status:

Header flags HEX Output

Is this actually useful for the user to see the hex codes? I think it would be much more useful to a human user to display the fields of the version struct. If you really want to display the hex code, the following section of source code might be interesting for you: Requirements::write

Some core header values are not parsed. Right now, it's just a hard coded list of some values I thought were important, but should extend to ALL values

We might want to add to the library a visitor pattern that visits each attribute. Do you think that makes sense? Something like:

header.visit_all_attributes(|name, value|{
    println!("{} (type {}): {}", ...);
})

@johannesvollmer
Copy link
Owner

https://github.com/johannesvollmer/exrs/pull/236/files

here is a prototype of the function, if you think it's useful, we can merge that

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

No branches or pull requests

2 participants