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

Re-encode example #418

Open
hoijui opened this issue Oct 11, 2023 · 2 comments
Open

Re-encode example #418

hoijui opened this issue Oct 11, 2023 · 2 comments

Comments

@hoijui
Copy link
Contributor

hoijui commented Oct 11, 2023

Hey! :-)
I would like to just add an iTXt text junk to an image, but otherwise leave it as it is, as much as possible.

There is docu for how to add the text junk when writing,
and there is docu for decoding and encoding separately.
I tried to figure out how to decode and encode again, 1:1, but I could not figure it out.
I imagine it is possible, as it is mentioned in #253,
but it is not shown there.
Would it be possible to add an example source file that decodes and encodes and changes a little thing in-between?
I'd be happy to provide the example, if I get some hints for how to do this.

@hoijui
Copy link
Contributor Author

hoijui commented Oct 12, 2023

I am a it puzzled by the whole interface.
there is an Info struct that seems to contain (all)? the settings. It is used by Decoder and Encoder, and it can be fetched from the Decoder, but not set on the Encoder, one has to manually transfer each setting ...
does this mimic some C interface, or why is it like that?

@fintelia
Copy link
Contributor

The overall interface predates my time as a maintainer and much of it likely even predates Rust 1.0. I wouldn't read too much into how the API is currently designed. At some point it would be nice to clean things up, but it has never been a priority.

I think it would be good to have an example like you describe, though as you're discovering it probably wouldn't end up looking very elegant.

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

No branches or pull requests

2 participants