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

Support for saving to memory needs better documention or consistent api #834

Closed
Timmmm opened this issue Nov 10, 2018 · 3 comments
Closed
Labels
easy kind: documentation An enhancement that does not change function kind: question

Comments

@Timmmm
Copy link

Timmmm commented Nov 10, 2018

Currently the only way to write a PNG image is to save it to a file. It would be nice if there was an API that took a std::io::Write (or std::io::Write + std::io::Seek) for cases when you want an in-memory image.

My use case is writing an SVG with an embedded image. I need to encode to PNG, then base64-encode the result and then write to disk.

@HeroicKatora
Copy link
Member

HeroicKatora commented Nov 10, 2018

This is possible with a DynamicImage or by using the png encoder interface directly. DynamicImage is a public enum of different ImageBuffer variants. But the api could be more consistent. Does this fit your usecase?

@Timmmm
Copy link
Author

Timmmm commented Nov 12, 2018

Ah yeah that works - probably sufficient to mention those in the ImageBuffer::save() API docs for now.

@HeroicKatora HeroicKatora changed the title Support saving to memory Support for saving to memory needs better documention or consistent api Nov 12, 2018
@HeroicKatora HeroicKatora added kind: documentation An enhancement that does not change function easy kind: question labels Apr 21, 2019
@HeroicKatora HeroicKatora added this to Planned in Version 0.23 Feb 9, 2020
@HeroicKatora HeroicKatora moved this from Planned to Cleanup in Version 0.23 Feb 9, 2020
@saiintbrisson
Copy link
Contributor

saiintbrisson commented Mar 10, 2021

@HeroicKatora I think you may close this issue now as #1449 solved it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
easy kind: documentation An enhancement that does not change function kind: question
Projects
Version 0.23
  
Cleanup
Development

No branches or pull requests

3 participants