brechtsanders / xlsxio

XLSX I/O - C library for reading and writing .xlsx files
MIT License
425 stars 113 forks source link

LIBREOFFICE #22

Closed ridams closed 6 years ago

ridams commented 6 years ago

The resulting xlsx on the demo doesn't open on libreoffice

brechtsanders commented 6 years ago

Any specific error message?

ridams commented 6 years ago

No just it shows that the file maybe corrupt and it tries to repair it but without success

brechtsanders commented 6 years ago

Can you send an example file generated with libreoffice?

brechtsanders commented 6 years ago

Just had a good look into the issue. I'm at the point where I have a seemingly good file that won't open in LibreOffice. However, if I unzip the xlsx file and re-zip it (using 7-Zip) it does open in LibreOffice. So now I'm going to investigate if this is a libzip issue...

brechtsanders commented 6 years ago

In the mean time I have tried to make libxlsxio_write use minizip instead of libzip, and the files generated this way do open in LibreOffice. So it must be an issue with how libzip generates zip files and how LibreOffice reads them. Yesterday libzip 1.5.0 was, so I tried with that version, but the problem remains. So I will try to also make libxlsxio_read use minizip and then make a new release that will fix your problem. Or you could try building libxlsxio_write with -DUSE_MINIZIP and link it against minizip instead of libzip. But I haven't updated the makefile yet.

brechtsanders commented 6 years ago

Just released version 0.2.12, which uses Minizip instead of libzip by default. This fixes the LibreOffice compatibility issue. Enjoy!