Uploaded image for project: 'Batik'
  1. Batik
  2. BATIK-672

SVG image with gradients color filling fails to render

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: In Progress
    • Resolution: Unresolved
    • Affects Version/s: 1.8
    • Fix Version/s: None
    • Component/s: Bridge
    • Labels:
      None
    • Environment:
      Operating System: Windows XP
      Platform: PC

      Description

      I have 2 SVG images one with flat color filling another with gradient color
      filling (will be attached). Both files were created with Inkscape 0.44.1 (open
      source program).
      The issue was discovered in GMF. A GMF client application is capable of
      dropping SVG image files on the diagram, hence image is rendered and drawn on
      the diagram surface. Essentially image with flat color filling is rendered and
      appears on the diagram, the image with gradient color filling fails to render
      and throws an exception: (info on exception from Eclipse error log)

      org.apache.batik.transcoder.TranscoderException: null
      Enclosed Exception:
      http://www.w3.org/2000/svg:-1
      An I/O error occured while processing the URI:
      "file:/C:/Documents and
      Settings/Daniel/Desktop/shape/aspect.svg#linearGradient1890"
      specified on the element <rect>

      Note: Full stack trace is provided on the bottom

      The file C:/Documents and Settings/Daniel/Desktop/shape/aspect.svg doesn't
      exist on my system, hence I removed the attribute referencing this file from
      the SVG file (gradient color filling) and everything worked out perfect, i.e.
      the image with gradient color is rendered. (Attribute:
      xml:base="file:/C:/Documents and Settings/Daniel/Desktop/shape/aspect.svg"
      inside the "svg" tag on the top of the file.)

      However, SVG image viewers/editors I've tried to open these 2 SVG files render
      both the flat color filling and the gradient color filling images without any
      problems or warning messages. That's why I think it could be a bug in batik.

      If this is not a batik bug, perhaps you could give an idea, what lead to this
      exception. Thanks in advance.

      Trace:

      org.apache.batik.transcoder.TranscoderException: null
      Enclosed Exception:
      http://www.w3.org/2000/svg:-1
      An I/O error occured while processing the URI:
      "file:/C:/Documents and
      Settings/Daniel/Desktop/shape/aspect.svg#linearGradient1890"
      specified on the element <rect>
      at
      org.eclipse.gmf.runtime.draw2d.ui.render.awt.internal.svg.ImageTranscoderEx.tra
      nscode(ImageTranscoderEx.java:306)

      at org.apache.batik.transcoder.XMLAbstractTranscoder.transcode(Unknown
      Source)

      at org.apache.batik.transcoder.SVGAbstractTranscoder.transcode(Unknown
      Source)

      at
      org.eclipse.gmf.runtime.draw2d.ui.render.awt.internal.svg.SVGImageConverter.set
      UpTranscoders(SVGImageConverter.java:148)

      at
      org.eclipse.gmf.runtime.draw2d.ui.render.awt.internal.svg.SVGImageConverter.ren
      derSVGtoSWTImage(SVGImageConverter.java:74)

      at
      org.eclipse.gmf.runtime.draw2d.ui.render.awt.internal.svg.SVGImage.renderImage
      (SVGImage.java:68)

      at
      org.eclipse.gmf.runtime.draw2d.ui.render.internal.AbstractRenderedImage.getSWTI
      mage(AbstractRenderedImage.java:130)

      at
      org.eclipse.gmf.runtime.draw2d.ui.render.figures.ScalableImageFigure.getPreferr
      edSize(ScalableImageFigure.java:258)

      at org.eclipse.draw2d.StackLayout.calculatePreferredSize
      (StackLayout.java:71)

      at org.eclipse.draw2d.AbstractLayout.getPreferredSize
      (AbstractLayout.java:93)

      at org.eclipse.draw2d.AbstractHintLayout.getPreferredSize
      (AbstractHintLayout.java:85)

      at org.eclipse.draw2d.Figure.getPreferredSize(Figure.java:735)

      at org.eclipse.draw2d.Figure.getPreferredSize(Figure.java:725)

      at org.eclipse.draw2d.DelegatingLayout.calculatePreferredSize
      (DelegatingLayout.java:49)

      at org.eclipse.draw2d.AbstractLayout.getPreferredSize
      (AbstractLayout.java:93)

      at org.eclipse.draw2d.Figure.getPreferredSize(Figure.java:735)

      at org.eclipse.draw2d.Figure.getPreferredSize(Figure.java:725)

      at
      org.eclipse.gmf.runtime.diagram.ui.figures.FixedDistanceGatedPaneFigure.layout
      (FixedDistanceGatedPaneFigure.java:157)

      at org.eclipse.draw2d.Figure.validate(Figure.java:1735)

      at org.eclipse.draw2d.Figure.validate(Figure.java:1737)

      at
      org.eclipse.gmf.runtime.diagram.ui.figures.BorderItemsAwareFreeFormLayer.valida
      te(BorderItemsAwareFreeFormLayer.java:53)

      at
      org.eclipse.gmf.runtime.diagram.ui.editparts.DiagramEditPart$1.validate
      (DiagramEditPart.java:163)

      at org.eclipse.draw2d.Figure.validate(Figure.java:1737)

      at
      org.eclipse.gmf.runtime.diagram.ui.figures.BorderItemsAwareFreeFormLayer.valida
      te(BorderItemsAwareFreeFormLayer.java:53)

      at org.eclipse.draw2d.Figure.validate(Figure.java:1737)

      at org.eclipse.draw2d.Figure.validate(Figure.java:1737)

      at org.eclipse.draw2d.Figure.validate(Figure.java:1737)

      at
      org.eclipse.draw2d.FreeformViewport$FreeformViewportLayout.calculatePreferredSi
      ze(FreeformViewport.java:28)

      at org.eclipse.draw2d.AbstractLayout.getPreferredSize
      (AbstractLayout.java:93)

      at org.eclipse.draw2d.AbstractHintLayout.getPreferredSize
      (AbstractHintLayout.java:85)

      at org.eclipse.draw2d.Figure.getPreferredSize(Figure.java:735)

      at org.eclipse.draw2d.ScrollPaneSolver.solve(ScrollPaneSolver.java:75)

      at org.eclipse.draw2d.FigureCanvas.layoutViewport
      (FigureCanvas.java:238)

      at org.eclipse.draw2d.FigureCanvas.access$4(FigureCanvas.java:236)

      at org.eclipse.draw2d.FigureCanvas$3.notifyValidating
      (FigureCanvas.java:201)

      at org.eclipse.draw2d.UpdateManager.fireValidating
      (UpdateManager.java:123)

      at org.eclipse.draw2d.DeferredUpdateManager.performValidation
      (DeferredUpdateManager.java:188)

      at
      org.eclipse.gmf.runtime.diagram.ui.parts.DiagramGraphicalViewer$ToggleUpdateMan
      ager.performValidation(DiagramGraphicalViewer.java:124)

      at org.eclipse.draw2d.DeferredUpdateManager.performUpdate
      (DeferredUpdateManager.java:165)

      at
      org.eclipse.gmf.runtime.diagram.ui.parts.DiagramGraphicalViewer$ToggleUpdateMan
      ager.performUpdate(DiagramGraphicalViewer.java:114)

      at org.eclipse.draw2d.DeferredUpdateManager$UpdateRequest.run
      (DeferredUpdateManager.java:46)

      at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)

      at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages
      (Synchronizer.java:123)

      at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3325)

      at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2971)

      at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1914)

      at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1878)

      at org.eclipse.ui.internal.Workbench.createAndRunWorkbench
      (Workbench.java:419)

      at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)

      at org.eclipse.ui.internal.ide.IDEApplication.run
      (IDEApplication.java:95)

      at org.eclipse.core.internal.runtime.PlatformActivator$1.run
      (PlatformActivator.java:78)

      at
      org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication
      (EclipseAppLauncher.java:92)

      at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start
      (EclipseAppLauncher.java:68)

      at org.eclipse.core.runtime.adaptor.EclipseStarter.run
      (EclipseStarter.java:400)

      at org.eclipse.core.runtime.adaptor.EclipseStarter.run
      (EclipseStarter.java:177)

      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

      at sun.reflect.NativeMethodAccessorImpl.invoke
      (NativeMethodAccessorImpl.java:64)

      at sun.reflect.DelegatingMethodAccessorImpl.invoke
      (DelegatingMethodAccessorImpl.java:43)

      at java.lang.reflect.Method.invoke(Method.java:615)

      at org.eclipse.core.launcher.Main.invokeFramework(Main.java:336)

      at org.eclipse.core.launcher.Main.basicRun(Main.java:280)

      at org.eclipse.core.launcher.Main.run(Main.java:977)

      at org.eclipse.core.launcher.Main.main(Main.java:952)

        Attachments

        1. SVG_gradient.svg
          8 kB
          Alex Boyko
        2. SVG_flat.svg
          10 kB
          Alex Boyko

          Activity

            People

            • Assignee:
              batik-dev@xmlgraphics.apache.org Batik Developer's Mailing list
              Reporter:
              aboyko@ca.ibm.com Alex Boyko
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated: