Bug 47430 - rendering problem with image in fo:block in multiple fo:inline
Summary: rendering problem with image in fo:block in multiple fo:inline
Status: NEW
Alias: None
Product: Fop - Now in Jira
Classification: Unclassified
Component: pdf (show other bugs)
Version: 0.95
Hardware: PC Windows Vista
: P3 normal
Target Milestone: ---
Assignee: fop-dev
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-06-25 10:14 UTC by Frank Worsley
Modified: 2012-04-07 01:52 UTC (History)
0 users



Attachments
the good rendering that is expected (49.15 KB, application/pdf)
2009-06-25 10:15 UTC, Frank Worsley
Details
the bad rendering that actually happens (49.15 KB, application/pdf)
2009-06-25 10:15 UTC, Frank Worsley
Details
a small XML-FO file that causes the bad rendering (1.29 KB, text/plain)
2009-06-25 10:16 UTC, Frank Worsley
Details
an image to use with the XML-FO example file (43.98 KB, image/jpeg)
2009-06-25 10:16 UTC, Frank Worsley
Details
another XML-FO test file that results in a bad rendering (1.13 KB, text/plain)
2009-07-05 21:51 UTC, Frank Worsley
Details
first attempt at patch that fixes the problem (3.11 KB, patch)
2009-07-05 21:54 UTC, Frank Worsley
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Frank Worsley 2009-06-25 10:14:31 UTC
This PDF rendering problem occurs with a fo:external-graphic nested inside of a fo:block that is itself nested inside at least two fo:inline elements.

See the attached "good.pdf" output for what I would expect and the "bad.pdf" output for what actually happens. The "test.fo.xml" file is a XML-FO example file that will produce the bad rendering.

Notice that removing either the fo:block or the second fo:inline element will fix the problem.
Comment 1 Frank Worsley 2009-06-25 10:15:03 UTC
Created attachment 23879 [details]
the good rendering that is expected
Comment 2 Frank Worsley 2009-06-25 10:15:26 UTC
Created attachment 23880 [details]
the bad rendering that actually happens
Comment 3 Frank Worsley 2009-06-25 10:16:23 UTC
Created attachment 23881 [details]
a small XML-FO file that causes the bad rendering
Comment 4 Frank Worsley 2009-06-25 10:16:42 UTC
Created attachment 23882 [details]
an image to use with the XML-FO example file
Comment 5 Frank Worsley 2009-07-05 21:51:48 UTC
Created attachment 23931 [details]
another XML-FO test file that results in a bad rendering
Comment 6 Frank Worsley 2009-07-05 21:54:53 UTC
Created attachment 23932 [details]
first attempt at patch that fixes the problem

I've attached a small patch that fixes the problem for me. I don't know enough about FOP to say whether this is the best approach.

Looking through the code it looks like it would be possible to get rid of InlineBlockParent. The differences between it and the basic InlineParent class are quite small. Cleaning up the patch to get rid of InlineBlockParent would probably be a good idea.
Comment 7 Frank Worsley 2009-07-05 22:15:09 UTC
Another comment: This patch causes quite a few of the unit tests to fail. Unfortunately I don't have time to look into why right now.
Comment 8 Andreas L. Delmelle 2009-07-06 06:39:41 UTC
(In reply to comment #7)

Hi Frank

> Another comment: This patch causes quite a few of the unit tests to fail.
> Unfortunately I don't have time to look into why right now.

No problem. The patch is already a good starting point, and shows where something is missing.

Thanks a lot for the contribution!
Comment 9 Glenn Adams 2012-04-07 01:42:59 UTC
resetting P2 open bugs to P3 pending further review