New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Background image with new option of dpi scaling and BIRT-properties #1255 #1256
Background image with new option of dpi scaling and BIRT-properties #1255 #1256
Conversation
and implementation of the BIRT-properties background-height & -width eclipse-birt#1255
…ky/birt into background_image_scaling_#1195
I didn't look at the code, just at the output. First of all, great work! This is absolutely OK for my use case. Do I understand correctly that "auto" (or not specified) the width and height is computed from the image's pixel and its DPI information? Did you also test with a different image without DPI information (such that the image has intrinsic proportions, but not intrinsci dimensions? If one dimension is specified and the other is auto, the behavior is not as expected according to https://developer.mozilla.org/en-US/docs/Web/CSS/background-size. Anyway, I don't mind. |
I downloaded the All-In-One-Designer artifact from this PR and tested myself. Though personally I don't mind the distorted image if only one dimension is specified, I think others might.
|
My target was to get a first step of improvement to get the base handling and I would say it is given.
The property of the DPI-usage directly on report level make no sense because you would say in this case all images must be use the same DPI-value. But in the most cases the it is specific of each image. |
Definitely this PR is an improvement to the current situation. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. Please go ahead and squash and merge.
I will double check the pull request due to the merge of the diagonal-antidiagonal changes. Independend of the merge I have done additional testings and added 2 changes (locally):
I check in the next days my standard test cases and if I can finish the test sucessfully I wil do an additional commit. |
…ky/birt into background_image_1255
@wimjongman Could you please re-check the additional changes before I start the merge. Thanks in advance. |
This is a bit too big to be reviewed. When looking at the code, I wonder how the images are disposed of. You know that creating images is notorious for memory leaks. Also, I see a lot of code that looks duplicated. There are a lot of new setImage methods. But the code is too big and spread out over too many files for me to be able to do a proper review. |
Yes, you are right that there are some codes "seems" to be duplicated. The reason is that the containing elements are completely different objects which are inherit from different parents. If you want, I cann add all of my test-reports to the pull request - here my test results like PDF-output. Please let me know what I can do to offer you the according/relevant information. |
An additonal information, the central handling of background images according with the disposing of images aren't changed from my side. The enhancement is located on the calculation of the image dimenson and there usage. |
Wow, coding after midnight! |
I agree with Wim that a lot of code seems duplicated. But that is caused by BIRT's internal concepts and code structure, as Thomas explained. I noticed this in my initial attempt (withdrawn PR). Regarding image disposal, I don't know when it happens but I'm pretty sure that the images are garbage-collected when the design is and the Run/Render/RunAndRenderTasks are gc-ed. |
Ok, so please merge. No guts, no glory. |
Merge is done. |
The changes of these request includes the new posibilities that BIRT is able to use the image resolution of the original image dpi to create the correct scaling of the image. In addition to it the base properties background image height and width can be used. The both properties are also able to be used on script level.
The change includes the changed components:
Till now the emitter wasn't able to scale the images. This option is added. To bet a better handling of all, the base class "background image info" is enhanced to implements the main functions and new properties.
Overview of changed classes:
Overview-Changed-Classes-1255.xlsx
Examples of testing:
Test-Examples-1255.zip
Expamples of results:
Result-Examples-1255.zip