When scaling an external graphic using <fo:external-graphic src="file:../graphics/ltcwidth.jpg" width="100%" content-width="scale-to-fit" content-height="100%"/> So that graphics that are too wide are scaled down but graphics that fit remain unscaled it does not operate as expected. Graphics that are too wide are invalidated Graphics the should not be scaled are streched to fit the width only.
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