Uploaded image for project: 'FOP'
  1. FOP
  2. FOP-3083

Referenced JPG image is not closed when TransformerException is thrown by transform()

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Not A Problem
    • 2.7
    • None
    • renderer/pdf
    • None
    • jdk-17.0.3.7-hotspot (Microsoft)

    Description

      We are trying to implement a workflow where the FO file and the images referenced within, are stored in a temporary directory which we can clear down once complete.

      When we disable strict FO validation, the approach works fine.

      However, when strict FO validation is enabled, a TransformerException is thrown (as expected for a poor FO). But it appears to keep the image file open until the JVM is shut down.

      I have checked through previous Jira entries and tried many other suggestions (clearing the image cache etc.) but we cannot seem to get the file closed.

      The attached example code snippet illustrates the behaviour. We would expect the example.jpg file to be deleted after processing.

      I hope I've provided enough here. Let me know if more detail is required.

      Attachments

        1. example.jpg
          2 kB
          Paul Sharp
        2. xsl-fo.xml
          83 kB
          Paul Sharp
        3. Code snippet.txt
          1 kB
          Paul Sharp

        Activity

          People

            Unassigned Unassigned
            paul.sharp Paul Sharp
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: