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

Zstd compression support #812

Closed
ghost opened this issue Jun 8, 2022 · 8 comments
Closed

Zstd compression support #812

ghost opened this issue Jun 8, 2022 · 8 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@ghost
Copy link

ghost commented Jun 8, 2022

Zstd GitHub Repo
Zstd Homepage

I don't expect this to happen anytime soon, it's just an idea for the future. You'd have to port Zstd to Android or wait for someone else to do it.

@zhanghai zhanghai self-assigned this Jun 11, 2022
@zhanghai zhanghai added the enhancement New feature or request label Jun 11, 2022
@zhanghai
Copy link
Owner

zhanghai commented Jun 11, 2022

Current the right way to do this with Commons Compress is to include zstd-jni. However, (zstd-jni-1.5.2-3.aar) adds an entire megabyte to the APK, and not everyone uses ZSTD, so I was a bit hesitent to ship it in this app - this app is just a file manager and isn't meant to be an advanced archiver app anyway (#193).

@ghost
Copy link
Author

ghost commented Jun 12, 2022

Current the right way to do this with Commons Compress is to include zstd-jni. However, (zstd-jni-1.5.2-3.aar) adds an entire megabyte to the APK, and not everyone uses ZSTD, so I was a bit hesitent to ship it in this app - this app is just a file manager and isn't meant to be an advanced archiver app anyway (#193).

I use zstd because of the compression ratio & speed; makes it easier to manage and store large collections of data. A megabyte is a drop in a bucket for me and I'd probably save a lot more storage if I had an easy way to use it, and it'd be really cool to have zstd in this app because currently no archive app on android to my knowledge has zstd support.
I can see your point, however it'd be very useful to me.

I have an idea, what if you made it a sort of plug-in app, that way it's a choice if the user wants to install it and use it within MFiles. It could be used to have a variety of compression types without bloating up the MFiles.
What do you think?

@zhanghai
Copy link
Owner

That theoratecally should work, but also requires inventing a plugin mechanism in this app.

@ghost
Copy link
Author

ghost commented Jun 12, 2022

Maybe taking a look at how other apps do it like Tachiyomi for example would be a good starting point?

@Vinfall
Copy link

Vinfall commented Apr 14, 2024

I know it's old, but since this topic is also brought up in #872 and #957, can you reconsider it?

Regarding the size increase, v1.5.2 from May 2022 is 8.13MB so 1MB sounds hugo indeed. However, latest v1.7.1 is 12.1MB already so maybe you don't mind adding another 1.1MB (latest zstd-jni-1.5.6-2.aar) to the APK?

@zhanghai
Copy link
Owner

@Vinfall I thought zstd should be working now since I implemented #735 ? Could you please double check?

@Vinfall
Copy link

Vinfall commented Apr 15, 2024

Weird, I think it's not working for me then. I'm using latest 1.7.1(36) F-Droid release and the tested .tar.zst file is compressed in Termux using:

PAR=blahblah
tar --use-compress-program="zstd -T0" -cvf proot-distro-backup.tar.zst -C $PAR/void .

A single file archive file.zst compressed using zstd file inside Termux does not work either.

Libarchive itself works fine on Linux & Windows 11 so I can't think up what's wrong with the linked library. Probably a permission issue due to blending Termux & Android? Or maybe it's the same as #804?

I can unzstd and untar the archive inside Termux so it's not really an issue. That being said, I'd appreciate it if you could add an option for using zstd to the compress menu Create archive if possible.

@zhanghai zhanghai reopened this Apr 16, 2024
@zhanghai zhanghai added this to the v1.7.2 milestone Apr 16, 2024
@zhanghai zhanghai added bug Something isn't working enhancement New feature or request and removed enhancement New feature or request bug Something isn't working labels Apr 16, 2024
@zhanghai
Copy link
Owner

The support has been there for some time - it's just that the app didn't recognize the MIME type for ZSTD files. This has been fixed now and will be in the next release.

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