Summary: | Graphic scaling scale-to-fit Not working as expected | ||
---|---|---|---|
Product: | Fop - Now in Jira | Reporter: | Tom <tom> |
Component: | images | Assignee: | fop-dev |
Status: | CLOSED FIXED | ||
Severity: | normal | ||
Priority: | P2 | ||
Version: | trunk | ||
Target Milestone: | --- | ||
Hardware: | Other | ||
OS: | other | ||
Attachments: |
Input fo file and associated external graphics
Pdf showing the output Pdf showing how it should be after patch is applied [PATCH] fixes the problem |
Description
Tom
2005-12-07 04:53:10 UTC
Created attachment 17163 [details]
Input fo file and associated external graphics
Created attachment 17164 [details]
Pdf showing the output
Created attachment 17165 [details]
Pdf showing how it should be after patch is applied
The fopbugeg.zip attached file contains an example that shows how it fails this example is an edited version of the images.fo example in the source tree. It is archived so that the images are in the same relative path as they were originaly. The before.pdf attached file shows the output as is generated with the current version. Created attachment 17166 [details]
[PATCH] fixes the problem
The issue seems to be caused by a lack of a cast before an integer divide is
assigned to a double eg.
double rat1 = cwidth / fobj.getIntrinsicWidth();
where both cwidth and the returned value are integers.
Adding a double cast to the cwidth seems to fix the problem eg.
double rat1 = (double) cwidth / fobj.getIntrinsicWidth();
The submited patch fixes this problem
I am no JAVA expert so I don't know if this is specific to the implementation
of JAVA I am running which is 1.5.0_05-b05
after.pdf shows the output after the patch is applied which is as I expect it
to be
Hope this helps and thanks to the development for all their good work
Patch applied. Thanks a lot for the detailed error description and the patch! http://svn.apache.org/viewcvs?rev=354757&view=rev batch transition pre-FOP1.0 resolved+fixed bugs to closed+fixed |