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

I found bundled C source code for 7z, rar, tar and zip, bzip2, is a concern, maybe out-of-date. #42

Open
rwperrott opened this issue Jul 22, 2024 · 4 comments

Comments

@rwperrott
Copy link

I looked at this because of surprising unarchiving failures by cbconvert.

I could see "C" references in the Go code, so assume that all of this C code is compiled for use by the Go code.

e.g. The unarrc/external/zlib/README starts with:

ZLIB DATA COMPRESSION LIBRARY

zlib 1.2.11 is a general purpose data compression library.  All the code is
thread safe.  The data format used by the zlib library is described by RFCs

The current zlib version from https://www.zlib.net/ is zlib 1.3.1, January 22, 2024.

It would probably have been smarter to dynamic bind to a 7z library for all the archive types, maybe a maintained Go library already exists for this, or the code could call CLI 7z/7zz, or archive specific CLI programmes.

This smells off.

@rwperrott
Copy link
Author

I had a look for 7z stuff on https://pkg.go.dev/, and saw:

unarr (github.com/gen2brain/go-unarr)

Package unarr is a decompression library for RAR, TAR, ZIP and 7z archives.
Imported by 36
| v0.2.3 published on Apr 23, 2024 | Zlib

So correction, it is maintained, however the bundled C source code still seems off.

@gen2brain
Copy link
Owner

C sources are updated when there is a need, and I don't see one. The usual distros probably have even older versions.

@rwperrott
Copy link
Author

rwperrott commented Jul 24, 2024

True, I noticed that with other people's, yours being the most recent upload!
I decided to write my own tool to process huge CB* and strip out junk, as a bash script, using 7zz (oddly rename more recent 7z) rather than the very dated 7z version used by various Linux tools, concurrent executions of mogrify of ImageMagic 7, a direct build/install, because not available on default repo, and used find for recursive search/execution. 7z can automatically handle a lot of different archive stuff itself, like ZIP64, and is very fast.
I was surprised that WEBP files can actually be larger than JPEG ones! AVIF is a no-starter currently because not supported by much yet.

@gen2brain
Copy link
Owner

The plan is to use https://github.com/gen2brain/jpegli for JPEG, resulting in much smaller files. I don't see the point in using the 7z or RAR, there is very little to gain as images are already compressed, and e.g. proprietary formats like RAR just create troubles. The gain you get in using e.g. jpegli, resizing to the appropriate size (i.e. instead of 6000x5000), converting black&white to 4bit uncompressed BMP, and then compressing, etc. IMO only .cbz should exist, or even better .cbt, but now it is too late. Anyway, all these formats are unofficial and are created by accident.

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

No branches or pull requests

2 participants