Skip to content
This repository has been archived by the owner on Jun 2, 2024. It is now read-only.

Allow custom DEFLATE compression level #212

Closed
MCOfficer opened this issue Nov 19, 2020 · 7 comments
Closed

Allow custom DEFLATE compression level #212

MCOfficer opened this issue Nov 19, 2020 · 7 comments

Comments

@MCOfficer
Copy link

MCOfficer commented Nov 19, 2020

I'm compressing a massive text file using this crate, which takes a lot of time using FileOptions::default(). I experimented with 7z, and setting the compression level to 1 produces almost the same filesize, but is significantly faster.

However, It seems like the compression level can't be set using this crate. Is this correct?

@Plecra
Copy link
Member

Plecra commented Nov 19, 2020

That's right, we don't support compression configuration just yet. Our backwards compatibility guarantees prevent us from adding it to the current API, so it'll need to be properly added in the next release.

That said, this would at least be possible with the raw reading API we're adding. Would that be any help for you?

@MCOfficer
Copy link
Author

That's right, we don't support compression configuration just yet. Our backwards compatibility guarantees prevent us from adding it to the current API, so it'll need to be properly added in the next release.

That said, this would at least be possible with the raw reading API we're adding. Would that be any help for you?

It may be, but i feel like i'm not getting it. How would this help me with creating a zip file?

@Plecra
Copy link
Member

Plecra commented Nov 19, 2020

It doesn't 😅 I misunderstood what you were doing. Annoyingly, there's quite a lot of bookkeeping involved that I can't simply factor out. I don't expect this to be solved before the new year.

@0ax1
Copy link

0ax1 commented Jul 1, 2021

+1 on that this would be a great addition. Are there any updates on the status?

@marcospb19
Copy link

+1, we would need this to solve ouch-org/ouch#52.

@Plecra could you give a status update on this? How hard is it to implement? I'd probably be able to help by the end of this year depending on the difficulties involved.

@marcospb19
Copy link

marcospb19 commented Oct 12, 2022

Should #286 close this? @Plecra?

@Plecra
Copy link
Member

Plecra commented Nov 14, 2022

It sure does! These days, writer.start_file("oopsies", FileOptions::default().compression_level(n))) will let you write a file with the compression level you like. Thanks for the bump ^^

@Plecra Plecra closed this as completed Nov 14, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants