xmlgraphics-fop-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 46048] New: Wrong images used (how to clear image cache?)
Date Tue, 21 Oct 2008 09:30:36 GMT

           Summary: Wrong images used (how to clear image cache?)
           Product: Fop
           Version: 0.95
          Platform: PC
        OS/Version: Windows 2000
            Status: NEW
          Severity: normal
          Priority: P2
         Component: images
        AssignedTo: fop-dev@xmlgraphics.apache.org
        ReportedBy: mhilpert@gmx.de

The problem: if an (SVG) image with the same file name (but different file
path!)  is generated more than 1 times, FOP always uses the (wrong) first

We use relative paths in our XSLs to reference SVG images. This worked good in
FOP 0.20.5 but doesn't work in FOP 0.95 anymore (well, it works with FOP 0.95
when called via FOP.bat but it doesn't work when called from within a Java app
via the FOP Java API). So I wrote a custom URIResolver to change the file name
to the current unique file path. This solves the problem of the (so far) not
working relative paths for images.

However, if a subsequent document generates the same report with the same file
but with different data, FOP doesn't use the newly generated file content but
the old image of the first report. I guess the internal image cache doesn't use
the resolved image file name but the first generated one.


1. XSL content:

<svg:image width="170mm" height="120mm" xlink:href="C_PerfRiskCons_M.svg"

2. custom URIResolver changes




with "dVwIIqKYfobFQDzUFJDQ5Er60ovA0G7YMpAVypnaMhY=" being a unique GUID for
each report.

=> it seems FOP 0.95 uses  
'file:/D:/Tmp/iComps/amc/reports/C_PerfRiskCons_M.svg' for the image cache
which would explain the faulty behaviour.

I tried to work around this by serializing report generation and clearing the
image cache before each report, but there is no
org.apache.fop.image.FopImageFactory.resetCache() anymore in FOP 0.95 and I
didn't find any other resetCache() method in the API.

How can I work around this?

Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

View raw message