Bug 491782 - .xml and images in sub-directories break images in PDF
Summary: .xml and images in sub-directories break images in PDF
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Publican
Classification: Community
Component: publican
Version: 2.0
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Ruediger Landmann
QA Contact: Joshua Wulf
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-03-24 02:25 UTC by Dana Mison
Modified: 2014-10-19 22:56 UTC (History)
7 users (show)

Fixed In Version: 1.0
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2009-11-26 04:57:53 UTC


Attachments (Terms of Use)

Description Dana Mison 2009-03-24 02:25:17 UTC
Description of problem:
if you have .xml files in a subdirectory of en-US and images in a subdirectory of en-US/images publican creates an incorrect path for the included image in the PDF.  It works fine with the html output

This is needed to try to maintain some source compatibility with some JBoss project docs

Version-Release number of selected component (if applicable):
0.44

How reproducible:
everytime

Steps to Reproduce:
1. Paths:
my_book/en-US/Chapter1/Section-A.xml
my_book/images/Chapter/figure.png

2. 
within my_book/en-US/Chapter1/Section-A.xml

<section>
    <title>A</title>
    
    <figure>
        <title>some figure</title>
        <mediaobject>
            <imageobject>
                <imagedata fileref="images/Chapter1/figure.png" />
            </imageobject>
        </mediaobject>
    </figure> 
</section>

3. make clean pdf-en-US

  
Actual results:
No image in PDF and this error message: 

Mar 24, 2009 12:07:35 PM org.apache.fop.fo.flow.ExternalGraphic bind
SEVERE: Image not found: Chapter-1/Chapter-1/images/Chapter-1/figure.png
Mar 24, 2009 12:07:35 PM org.apache.fop.render.pdf.PDFRenderer putImage
SEVERE: Image not found: Chapter-1/Chapter-1/images/Chapter-1/figure.png


Expected results:
Image in PDF

Additional info:
This can be worked around in the PDF by supplying the path as:  ../../images/Chapter1/figure.png , but this breaks the html

Comment 1 Jeff Fearn 🐞 2009-03-24 03:33:15 UTC
Could you test this for me on a some books?

test1: with flat xml and flat images

test2: with flat xml and nested images

test3: with nested xml and flat images

test4: with nested xml and nested images

proposed change:

edit: /usr/share/publican/pdf.xsl

on line 58 change: keep.relative.image.uris from select="0" to select="1"

FYI: Zero is the default in the DocBook xslt for FO output.

Comment 2 Dana Mison 2009-04-08 06:04:45 UTC
keep.relative.image.uris  select="1" works

tested with pdf, html and html-single

only in English, don't know if there would be any translation issues

Comment 3 Andrew Ross 2009-04-09 21:28:12 UTC
YAY. That was driving me nuts!

Minor typo in the path

/usr/share/publican/xsl/pdf.xsl

Comment 4 Michael Hideo 2009-06-17 02:06:22 UTC
Hi Darrin, is this still a problem with the latest release?

Comment 5 Andrew Ross 2009-06-17 02:22:34 UTC
Still broken in publican-0.45-0.el5

eg. SEVERE: Image not found: PC_Setup/images/Vpn/WiFi-WEP.png

Comment 6 Dana Mison 2009-06-29 05:53:29 UTC
ah, yeah still broken.  I'd modifed my pdf.xsl as per above & had to reinstall to check.

Comment 7 Jeff Fearn 🐞 2009-08-10 23:25:34 UTC
This should be fixed in the BETA.

Comment 8 Ruediger Landmann 2009-09-08 05:54:59 UTC
The version of pdf.xsl installed by the BETA still contains select="0" and therefore does not include images when both the XML and the images are in subdirectories, as originally reported.

Changing to select="1" allows the BETA find the images and include them correctly.

Comment 9 Jeff Fearn 🐞 2009-09-08 23:26:20 UTC
Check in this fix, so it will be in 1.0:

$ svn diff -r779:780 datadir/xsl/pdf.xsl 
Index: datadir/xsl/pdf.xsl
===================================================================
--- datadir/xsl/pdf.xsl (revision 779)
+++ datadir/xsl/pdf.xsl (revision 780)
@@ -58,7 +58,7 @@
 <xsl:param name="fop1.extensions" select="1"/>
 <xsl:param name="img.src.path"/>
 <xsl:param name="qandadiv.autolabel" select="1"/>
-<xsl:param name="keep.relative.image.uris" select="0"/>
+<xsl:param name="keep.relative.image.uris" select="1"/>
 <xsl:param name="email.delimiters.enabled">0</xsl:param>
 
 <xsl:param name="hyphenation-character">

Comment 10 Ruediger Landmann 2009-09-09 22:47:56 UTC
Fixed in 1.0

With that modification to pdf.xsl, Publican finds and uses the image correctly.

Comment 12 Fedora Update System 2009-11-18 02:19:18 UTC
publican-1.2-0.fc12 has been submitted as an update for Fedora 12.
http://admin.fedoraproject.org/updates/publican-1.2-0.fc12

Comment 13 Fedora Update System 2009-11-20 05:18:26 UTC
publican-1.2-0.fc12 has been pushed to the Fedora 12 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 14 Fedora Update System 2009-11-25 14:53:33 UTC
publican-1.2-0.fc11 has been pushed to the Fedora 11 stable repository.  If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.