https://bz.apache.org/bugzilla/show_bug.cgi?id=57634
Bug ID: 57634
Summary: Incorrect picture resizing
Product: POI
Version: 3.11-FINAL
Hardware: PC
Status: NEW
Severity: major
Priority: P2
Component: SS Common
Assignee: [email protected]
Reporter: [email protected]
After update to poi 3.11, picture resizing works incorrect. It stretches
picture by height and width with methods Picture.resize(double) and
Picture.resize(double, double) for XSSFPicture.
Steps to reproduce:
1. Load image less by size than target cell.
2. Create anchor and set col1 and row1
3. Put image on anchor
4. Resize it by Picture.resize(). Now we adjusted anchor to image size.
5. Resize it again with Picture.resize(1.0).
6. Write workbook.
What is expected:
Picture with original size.
What is actual:
Picture is stretched by width and height with different scale.
The problem in new method
Dimension org.apache.poi.ss.util.ImageUtils.getDimensionFromAnchor(Picture
picture).
Line 231 and 251: w = sheet.getColumnWidthInPixels(col2++); h =
getRowHeightInPixels(sheet,row2++); Here we ALWAYS take cell dimension and in
next steps add additional sizes based on getDy2 and getDx2.
--
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]