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

When using absolute path in url without protocol fop cannot resolve it

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Won't Fix
    • Affects Version/s: 2.0
    • Fix Version/s: None
    • Component/s: unqualified
    • Labels:
    • Environment:
      windows 8 java 1.6
    • Flags:
      Important

      Description

      Hi guys.

      Using xmlfast I try to put image on page. It creates output
      <fo:external-graphic scaling="uniform" content-width="26.5mm" content-height="28.0mm" left="0.0mm" top="0.0mm" position="relative" src="url(C/data/resource_store/images/someImage.jpg)"/>
      When I tried to render page image hadn't rendered.

      Relative path is working fine
      e.g. url('../data/resource_store/images/someImage.jpg').

      Absolute url is not resolving correctly. The only way to resolve it is by using "file:" protocol before path
      e.g. url('file:C/data/resource_store/images/someImage.jpg').
      is working fine.

      The problem is located in method class FOUserAgent line 413.
      resourceResolver.getResource(uri) throws MalformedURLException with message unknown protocol c:
      If you dig little bit deeper you will find that problem is in class NormalResourceResolver on 224 line
      return new Resource(uri.toURL().openStream());

      uri.toURL throws exception because cannot parse absolute path without protocol..

      Fop version 1.1 is rendering absolute path correctly. 2.1 version is impacted either.

      Please fix

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              OlegSydorenko Oleg Sydorenko
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - 168h
                168h
                Remaining:
                Remaining Estimate - 168h
                168h
                Logged:
                Time Spent - Not Specified
                Not Specified