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
Turn on ZIP64 support #228
Comments
Agreed. That could/should be added. It is supported in the Python version of the library: https://xlsxwriter.readthedocs.io/workbook.html#workbook-use-zip64 |
I've added this to master. From the docs:
And from a sample file generated with the ZIP64 extensions:
|
Would |
That was my first thought but the Python version uses a function/method (use_zip64()) so I went with that. The |
Well, I have been using libxlsxwriter in shipping code for a number of years, and Zip64 wasn't something I knew I needed until recently. It took some fairly deep debugging to figure out that its absence was triggering write failures. If it had been an advertised option sooner, I certainly would have enabled it. So I suspect that many clients of libxlsxwriter will choose to enable Zip64 once they are made aware of it. One advantage of using an option instead of a function is that in the future, you will be able to make Zip64 the default (opt-out) without changing the API. The new API is opt-in only. |
Okay. I'm persuaded. I'll enable it in the |
I've refactored the int main() {
lxw_workbook_options options = {.constant_memory = LXW_FALSE,
.tmpdir = NULL,
.use_zip64 = LXW_TRUE};
lxw_workbook *workbook = workbook_new_opt("zip64.xlsx", &options);
lxw_worksheet *worksheet = workbook_add_worksheet(workbook, NULL);
... When you get a chance try it out and see what you think. The docs have been updates as well. |
After I fix the failing test cases on Linux. |
Okay. Master is fixed again. |
The new code is working as expected. Thanks. |
I get an error when creating an especially large XLSX file (see #227). The underlying error is
ZIP_BADZIPFILE
, triggered athttps://github.com/jmcnamara/libxlsxwriter/blob/master/third_party/minizip/zip.c#L1731
I believe this can be fixed by changing the last argument to
zipOpenNewFileInZip4_64
be1
instead of0
here:https://github.com/jmcnamara/libxlsxwriter/blob/master/src/packager.c#L1063-L1069
I.e. that turns on Zip64 support which permits 4GB+ uncompressed file sizes to be written.
The text was updated successfully, but these errors were encountered: