MaterialFiles icon indicating copy to clipboard operation
MaterialFiles copied to clipboard

Zstd compression support

Open gghhkm opened this issue 2 years ago • 4 comments

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.

gghhkm avatar Jun 08 '22 21:06 gghhkm

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).

zhanghai avatar Jun 11 '22 22:06 zhanghai

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?

ghost avatar Jun 12 '22 05:06 ghost

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

zhanghai avatar Jun 12 '22 06:06 zhanghai

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

ghost avatar Jun 12 '22 06:06 ghost

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?

Vinfall avatar Apr 14 '24 10:04 Vinfall

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

zhanghai avatar Apr 14 '24 19:04 zhanghai

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.

Vinfall avatar Apr 15 '24 01:04 Vinfall