Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 240805

Summary: [Improve Report Layout Capabilities] Provide ability to scale big image ot fit a page for PDF
Product: z_Archived Reporter: Kirill A. Balod <Kirill.Balod>
Component: BIRTAssignee: Yu Chen <yChen>
Status: VERIFIED FIXED QA Contact: Tianli Zhang <tzhang>
Severity: enhancement    
Priority: P3 CC: bluesoldier, grspence, gumingbj, hustlg, jerlich, richard.gronback, rlu, wenfeng.fwd, whe, wyan, xxue, yChen, yli, zqian
Version: 2.3.0Keywords: plan
Target Milestone: 2.5.0 M5   
Hardware: PC   
OS: Windows XP   
Whiteboard: Non-Auto
Attachments:
Description Flags
Not just for PDF none

Description Kirill A. Balod CLA 2008-07-15 07:08:35 EDT
Build ID: I20080617-2000

Steps To Reproduce:
I have a lot of dynamic images with unpredictable size.
In pdf only part of big images are shown.
Should be possible so set some property for Image item to scale it if bigger then page.

More information:
Comment 1 Gang Liu CLA 2008-07-17 05:04:11 EDT
To support this feature, a solution is to add add two properties: maxWidth and maxHeight on image item.
Comment 2 Wenfeng Li CLA 2008-07-21 20:28:54 EDT
(In reply to comment #1)
> To support this feature, a solution is to add add two properties: maxWidth and
> maxHeight on image item.

How about use fit-to-container property to image report item, instead of setting maxWidth/maxHeight?

It will be better to have fit-to-container property for data, chart, label, and text report items too.
Comment 3 Zhiqiang Qian CLA 2008-07-21 23:14:05 EDT
For image currently we already have a "Size" property, which contains three choices:

Clip - clip the image with specified image item size
Scale to item - scale the image to specified image item size
Size to image - use actual image size for image item

I think we can just add support for this, and may add another property "keep proportion" for scaling control.

Comment 4 Wei Yan CLA 2008-12-29 04:50:02 EST
*** Bug 241194 has been marked as a duplicate of this bug. ***
Comment 5 Wei Yan CLA 2008-12-29 22:00:29 EST
1. remove the scale/size from the image item as they can be replaced by other properties.
scale: the scale ratio of the image. It is defined by the image-width/image-height.
size has three values:
  * clip: the user can put the image into a fix sized container.
  * scale to item: the user defines the width/height.
  * scale to image: the user defines the width/height empty

2. add a new property for the image item: fit-in-container. It means:
  * calculate the image size. the image size can be defined by the user or use the intrinsic size.
  * if the user defines fit-in-container and the image size is larger than the container size, scale the image to container with proportion.
  * use the calculated size to display the image.
Comment 6 Gang Liu CLA 2009-01-22 21:40:42 EST
*** Bug 260776 has been marked as a duplicate of this bug. ***
Comment 7 Gang Liu CLA 2009-01-22 21:44:02 EST
*** Bug 244882 has been marked as a duplicate of this bug. ***
Comment 8 Yu Chen CLA 2009-02-01 03:59:02 EST
assign to model team for adding an new property "fit-to-container".
Comment 9 hong chen CLA 2009-02-01 22:27:40 EST
provided property fitToContainer on image item. 
reassign to engine team.
Comment 10 Yu Chen CLA 2009-02-02 22:21:42 EST
Fixed.
Comment 11 George Spencer CLA 2009-02-03 14:05:58 EST
Created attachment 124591 [details]
Not just for PDF

The bug was reported to exist on all forms of image outputs.

Specifically, we cannot generate a high resolution image and have it:

Confined to some space exceed neither an upper width nor upper length, while at the same time, maintaining the original aspect ratio.

This applies to PDF, Powerpoint, and MS Word, etceterea.

Thanks.
Comment 12 Tianli Zhang CLA 2009-02-05 04:02:01 EST
Verified in 2.5.0 v20090204-0630 build. Fit to container property of enlarged image works in PDF, PPT, MS Word AND Postscript. During the verification, a issue has been found, please refer to bug #263754. Mark this bug as verified.