Fop
  1. Fop
  2. FOP-1429

[PATCH] FOP cannot render (g-)zipped graphics

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Resolution: Fixed
    • Affects Version/s: 0.94
    • Fix Version/s: None
    • Component/s: images
    • Labels:
      None
    • Environment:
      Operating System: Windows XP
      Platform: PC
    • External issue ID:
      43597

      Description

      When graphic files are not unzipped manually before rendering the xml-file to
      pdf, they are not included in the pdf. As it is standard that e.g. mapservers
      return g-zipped svgs, it would be convenient if fop could render them as does
      e.g. Antennahouse xsl-Formatter or Ecrion XF Rendering Server.

      Example xsl-Fragment:
      <fo:external-graphic content-height="100mm" content-width="100mm"
      src="D:/temp/test.svg.gz"/>

      1. svgz.patch
        3 kB
        Max Berger

        Activity

        Hide
        Max Berger added a comment -

        I really like this idea, as svgz is an almost-standard format. I've implemented
        a similar thing for MathML in zip files (ODF), so it should be possible to adapt
        this to autodetect gzipped xml files, which would then apply to both svg and mathml.

        I'll look into that and will provide either a patch or more information by this
        weekend.

        Show
        Max Berger added a comment - I really like this idea, as svgz is an almost-standard format. I've implemented a similar thing for MathML in zip files (ODF), so it should be possible to adapt this to autodetect gzipped xml files, which would then apply to both svg and mathml. I'll look into that and will provide either a patch or more information by this weekend.
        Hide
        Max Berger added a comment -

        I had less time than I wished, but I promised a patch, so here it is. Please be
        warned that this is an out-of-my-head and untested implementation. There is
        definitely room for improvement here.

        When looking again at the SVG / XML image code I saw that there are bigger
        patches for a "proper" solution (xmlreader and svgreader could be unified, svg
        images are loaded twice, etc.)

        Show
        Max Berger added a comment - I had less time than I wished, but I promised a patch, so here it is. Please be warned that this is an out-of-my-head and untested implementation. There is definitely room for improvement here. When looking again at the SVG / XML image code I saw that there are bigger patches for a "proper" solution (xmlreader and svgreader could be unified, svg images are loaded twice, etc.)
        Hide
        Max Berger added a comment -

        Attachment svgz.patch has been added with description: 1st iteration svgz patch

        Show
        Max Berger added a comment - Attachment svgz.patch has been added with description: 1st iteration svgz patch
        Hide
        Andreas Kempf added a comment -

        (In reply to comment #2)
        > Created an attachment (id=20984) [edit]
        > 1st iteration svgz patch
        > I had less time than I wished, but I promised a patch, so here it is.

        Dear Max,
        I have tested your patch quickly and it seems to run well. Thank you very much
        for your quick help,
        cheers Andi

        Show
        Andreas Kempf added a comment - (In reply to comment #2) > Created an attachment (id=20984) [edit] > 1st iteration svgz patch > I had less time than I wished, but I promised a patch, so here it is. Dear Max, I have tested your patch quickly and it seems to run well. Thank you very much for your quick help, cheers Andi
        Hide
        Max Berger added a comment -

        I've looked again into the Image / XML handling, and a more in-depth approach is
        required to fix this "properly" for all cases, the old thread "thoughts about
        image handling" contains some of the ideas.

        Right now, SVG support is "hard coded" into different renderes which is imo not
        the best approach. Since this patch supports SVGZ the same way as SVG, it works
        just fine for SVG, but not for other formats (MathML-Z, if someone would ever
        want that.) However, fixing this requires much for time and thought.

        Since this approach works for now, it can be applied to add the extra
        functionalty. I am therfore changing the subject to [PATCH].

        Show
        Max Berger added a comment - I've looked again into the Image / XML handling, and a more in-depth approach is required to fix this "properly" for all cases, the old thread "thoughts about image handling" contains some of the ideas. Right now, SVG support is "hard coded" into different renderes which is imo not the best approach. Since this patch supports SVGZ the same way as SVG, it works just fine for SVG, but not for other formats (MathML-Z, if someone would ever want that.) However, fixing this requires much for time and thought. Since this approach works for now, it can be applied to add the extra functionalty. I am therfore changing the subject to [PATCH] .
        Hide
        Jeremias Maerki added a comment -

        Patch applied, thanks.
        http://svn.apache.org/viewvc?rev=587052&view=rev

        FYI, rewriting the whole image package is on the top of my todo list now. Should
        all happen in the next few weeks. I'll see what I can do for general support for
        GZIPped content.

        Show
        Jeremias Maerki added a comment - Patch applied, thanks. http://svn.apache.org/viewvc?rev=587052&view=rev FYI, rewriting the whole image package is on the top of my todo list now. Should all happen in the next few weeks. I'll see what I can do for general support for GZIPped content.
        Hide
        Glenn Adams added a comment -

        batch transition pre-FOP1.0 resolved+fixed bugs to closed+fixed

        Show
        Glenn Adams added a comment - batch transition pre-FOP1.0 resolved+fixed bugs to closed+fixed

          People

          • Assignee:
            fop-dev
            Reporter:
            Andreas Kempf
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development