https://bugs.documentfoundation.org/show_bug.cgi?id=163384
Bug ID: 163384
Summary: CALC shows a POI SXSSF file as corrupted unless
Zip64Mode.AlwaysWithCompatibility is used.
Product: LibreOffice
Version: 24.8.2.1 release
Hardware: x86-64 (AMD64)
OS: Linux (All)
Status: UNCONFIRMED
Severity: normal
Priority: medium
Component: Calc
Assignee: [email protected]
Reporter: [email protected]
Description:
Greetings.
We write XLSX files using Apache POI in XSSF and SXSSF mode. The XML content of
those files is the same, but LibreOffice shows a "Corrupted" message when
opening the SXSSF version. It can be repaired though without any damage or
losses.
Excel and Gnumeric and Google Sheet open those files without any complains.
Forcing Zip64Mode.AlwaysWithCompatibility also works around the problem, but
increases the file size.
Careful: Zip64Mode.Never will freeze LibreCalc in an endless loop forever!
Sample java code to reproduce the problem is shown below.
Sample XLSX file is here:
https://manticore-projects.com/download/manticore_7841765197550883476.xlsx
Version: 24.2.6.2 (X86_64) / LibreOffice Community
Build ID: 5d815fb18c57fdadb2819d0f77b22a22936c58ed
CPU threads: 12; OS: Linux 6.11; UI render: default; VCL: gtk3
Locale: en-US (en_US.UTF-8); UI: en-US
24.2.6-5.1
Calc: threaded
Steps to Reproduce:
// Sample Java code to produce such files
import org.apache.commons.compress.archivers.zip.Zip64Mode;
import org.apache.poi.xssf.streaming.SXSSFSheet;
import org.apache.poi.xssf.streaming.SXSSFWorkbook;
import org.apache.poi.xssf.usermodel.XSSFSheet;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
public class Main {
public static void main(String[] args) {
// this will cause corruption
SXSSFWorkbook wb = new SXSSFWorkbook(new XSSFWorkbook(), 100, true,
true);
SXSSFSheet sheet = wb.createSheet("test");
// wb.setZip64Mode(Zip64Mode.AlwaysWithCompatibility);
// this will work
// XSSFWorkbook wb = new XSSFWorkbook();
// XSSFSheet sheet = wb.createSheet("test");
File outputFile = null;
try {
outputFile = File.createTempFile("poitest_", ".xlsx");
FileOutputStream fileOutputStream = new
FileOutputStream(outputFile);
wb.write(fileOutputStream);
wb.close();
} catch (IOException e) {
throw new RuntimeException(e);
}
}
}
Actual Results:
File shows Corruption Warning when opening in LibreCalc.
Expected Results:
File should be opened as valid (since it can be unzipped and also open in
Excel, Gnumeric and Google Sheets)
Reproducible: Always
User Profile Reset: No
Additional Info:
Pl
--
You are receiving this mail because:
You are the assignee for the bug.