https://bz.apache.org/bugzilla/show_bug.cgi?id=59290
Bug ID: 59290
Summary: EMF images embedded in excel spreadsheet are returned
much smaller the actual file image
Product: POI
Version: unspecified
Hardware: PC
Status: NEW
Severity: normal
Priority: P2
Component: XSSF
Assignee: [email protected]
Reporter: [email protected]
No matter how I try to get the picture data (byte array) it is always MUCH
smaller then what is actual image embedded in the excel file for EMF images. I
know this is fact because I took an Excel file (say X.xlsx) made a copy of
this file and renamed it it to X.zip. Open the archive and went to the
\xl\media\ folder and the embedded original image files are listed in their
full original size and resolutions. For example one emf image had a size of
804,036 bytes. If I call the getData on the picture programmatically using the
below code the byteArray is a much smaller, for that same image for example it
was 129KB instead of 804KB. The image is a valid image just much lower quality
to the point that I really can't use it. Is there some hidden scaling down of
EMI images? If so can I control this?
InputStream inp = new FileInputStream(xlsxFilename);
Workbook wb = WorkbookFactory.create(inp);
XSSFSheet sheet = (XSSFSheet) wb.getSheetAt(0);
for (XSSFShape shape : sheet.getDrawingPatriarch().getShapes()) {
XSSFPicture picture = (XSSFPicture) shape;
byte[] imageBytes = picture.getPictureData().getData();
.....
}
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]