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

Add a streaming writer #102

Merged
merged 1 commit into from
Apr 19, 2019
Merged

Add a streaming writer #102

merged 1 commit into from
Apr 19, 2019

Conversation

birktj
Copy link
Member

@birktj birktj commented Feb 1, 2019

This adds a streaming png writer so that you can create images that do not fit in memory. I choose to not update Writer::write_image_data as the StreamWriter has a few layers of buffering that may reduce performance a little bit. I selected a default chunk size of 4k, this number was a bit out of thin air, however there are only a few extra bytes per chunk so I don't think it will be a problem.

Fixes #75

@fintelia
Copy link
Contributor

This all looks good to me. Other than that one conflict in lib.rs, is there anything else needed before merging this?

@birktj
Copy link
Member Author

birktj commented Apr 19, 2019

@fintelia I have rebased on master now. I am reasonably sure that this should be ready for merging.

@fintelia fintelia merged commit ae1904c into image-rs:master Apr 19, 2019
@fintelia
Copy link
Contributor

Thanks!

@udscbt-wsx
Copy link

udscbt-wsx commented May 5, 2019

Thanks @birktj for your work! I have two questions regarding this feature:

  1. When will StreamWriter be in a future release?
  2. Also, is it possible to make StreamWriter to own a Writer underneath instead of borrowing it, so that we can eliminate the lifetime parameter in StreamWriter<'a, W>?

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.

Images must be written all at once or not at all
3 participants