Uploaded image for project: 'XMLGraphicsCommons'
  1. XMLGraphicsCommons
  2. XGC-12

XMLGraphics does not accept SAXSource'd images anymore after the latest image loaders changes [w-patch]

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Resolution: Fixed
    • 2.6
    • None
    • utilities
    • None
    • Operating System: All
      Platform: All

    Description

      XMLmind XMLEditor is using custom URI resolver for FOPFactory, for all resolved URIs it is returning
      SAXSource rather than StreamSource.
      Before 1.3 and latest FOP changes, images were loaded properly, but with latest trunk of FOP I started
      getting: [FOP Error] No ImagePreloader for ... and then Cannot open image (because URI was cached as
      wrong).

      After hours of digging I found out that URI resolver of XMLmind is returning always SAXSource, while src/java/org/apache/xmlgraphics/image/loader/impl/AbstractImageSessionContext.java @ newSource
      expects StreamSource. Also image loaders work only with ImageSource, that was created only from
      StreamSource, with generic Source they fail.

      I'm attaching patch for AbstractImageSessionContext.java that checks also for SAXSource and allows
      using its inputSource's byte stream.

      This makes XMLmind FOP addon again usable with latest FOP trunk.

      Attachments

        1. xg-commons-use-SAXSource.patch
          3 kB
          Adam Strzelecki

        Activity

          People

            general@xmlgraphics.apache.org XML Graphics Project Mailing List
            ono@java.pl Adam Strzelecki
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: