You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@poi.apache.org by bu...@apache.org on 2015/02/25 10:37:46 UTC

[Bug 57634] New: Incorrect picture resizing

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: dev@poi.apache.org
          Reporter: solid.danil@gmail.com

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: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 57634] Incorrect picture resizing

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=57634

--- Comment #3 from Danil Lopatin <so...@gmail.com> ---
Yes, I read your comment and saw what you did.
Have you tried steps to reproduce it which were provided here?

Will provide test or/and patch in process of time.

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 57634] Incorrect picture resizing

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=57634

Andreas Beeker <ki...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |DUPLICATE
             Status|NEEDINFO                    |RESOLVED

--- Comment #2 from Andreas Beeker <ki...@apache.org> ---
Have you looked into my comment in #55967? (the original issue to image
resizing)

If you aren't satisfied with the reasoning, please reopen and continue the
discussion there

*** This bug has been marked as a duplicate of bug 55967 ***

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 57634] Incorrect picture resizing

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=57634

Nick Burch <ap...@gagravarr.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |NEEDINFO
                 OS|                            |All

--- Comment #1 from Nick Burch <ap...@gagravarr.org> ---
Are you able to produce a junit unit test showing the problem, and/or a patch
to correct the logic?

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org