Bug 54542 - [PATCH] Add support for cropped images in XSLFPictureShape.drawContent()
Summary: [PATCH] Add support for cropped images in XSLFPictureShape.drawContent()
Alias: None
Product: POI
Classification: Unclassified
Component: XSLF (show other bugs)
Version: 3.9-FINAL
Hardware: Macintosh Mac OS X 10.4
: P2 normal (vote)
Target Milestone: ---
Assignee: POI Developers List
Depends on:
Reported: 2013-02-10 16:38 UTC by Don Boulia
Modified: 2014-10-27 00:07 UTC (History)
0 users

Patch for cropped images in XSLF (86.88 KB, application/x-gzip)
2013-02-10 16:38 UTC, Don Boulia

Note You need to log in before you can comment on or make changes to this bug.
Description Don Boulia 2013-02-10 16:38:28 UTC
Created attachment 29937 [details]
Patch for cropped images in XSLF

XSLFSlide.draw() doesn't currently support drawing cropped images in slides.  This patch implements support for cropping and includes a test pptx that shows various types of cropped images.
Comment 1 Cédric Walter 2013-10-11 15:16:03 UTC
you need to add at least a testcase for the patch to be accepted.
Comment 2 Don Boulia 2013-11-04 17:52:45 UTC
(In reply to Cédric Walter from comment #1)
> you need to add at least a testcase for the patch to be accepted.

I did include an example .pptx in the patch under the test-data/slideshow directory that shows the problem and demonstrates the difference.  Since this is a display issue it requires visual inspection to see the before and after.

test-data/slideshow seemed to be the place where other display related test cases were placed in the source tree, perhaps that was an incorrect assumption.
Comment 3 Nick Burch 2013-11-07 22:02:00 UTC
In terms of a unit test, ideally we'd have something that writes an image with and without clipping, saves it, loads the new file, and checks that the right data got written in. That would then be used in combination with any manual visual testing
Comment 4 Andreas Beeker 2014-10-27 00:07:39 UTC
I've added a disabled test case for visual - i.e. manual - comparison.
Similar to TestFontRendering it doesn't make sense to compare images because of tiny rendering differences in windows/unix.
Apart of that, I thought it's better to work with clipping instead of image manipulation before the image is written to the graphics context ... at least the test file and other manual tests, e.g. with negative cropping values, looked good
Applied with r1634410