Modify

Opened 7 years ago

Closed 7 years ago

#8577 closed defect (fixed)

Exception with empty SVG as image

Reported by: imagic Owned by: team
Priority: trivial Milestone:
Component: Core mappaint Version: latest
Keywords: Cc:

Description

The following MapCSS style creates an IllegalArgumentException when at least one node is displayed. JOSM has to be killed afterwards.

1) MapCSS style: an empty SVG is given as icon image.
node
{

icon-image: "data:image/svg+xml,<svg></svg>";

}

2) Bug report from JOSM
Repository Root: http://josm.openstreetmap.de/svn
Build-Date: 2013-04-03 01:34:03
Last Changed Author: stoecker
Revision: 5823
Repository UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b
URL: http://josm.openstreetmap.de/svn/trunk
Last Changed Date: 2013-04-02 17:45:13 +0200 (Tue, 02 Apr 2013)
Last Changed Rev: 5823

Identification: JOSM/1.5 (5823 de) Linux
Memory Usage: 169 MB / 853 MB (38 MB allocated, but free)
Java version: 1.6.0_20, Sun Microsystems Inc., Java HotSpot(TM) Server VM
Operating system: Linux
Dataset consistency test: No problems found

Plugin: buildings_tools (29210)
Plugin: imagery_offset_db (29450)
Plugin: openstreetbugs (29373)
Plugin: openvisible (29222)
Plugin: reverter (29359)
Plugin: turnrestrictions (29210)
Plugin: utilsplugin2 (29392)

java.lang.IllegalArgumentException: Width (0) and height (0) cannot be <= 0

at java.awt.image.DirectColorModel.createCompatibleWritableRaster(DirectColorModel.java:999)
at java.awt.image.BufferedImage.<init>(BufferedImage.java:321)
at org.openstreetmap.josm.tools.ImageProvider.createImageFromSvg(ImageProvider.java:869)
at org.openstreetmap.josm.tools.ImageResource.getImageIcon(ImageResource.java:56)
at org.openstreetmap.josm.tools.ImageProvider.get(ImageProvider.java:276)
at org.openstreetmap.josm.tools.ImageProvider.getInBackground(ImageProvider.java:301)
at org.openstreetmap.josm.gui.mappaint.MapImage.getImage(MapImage.java:56)
at org.openstreetmap.josm.gui.mappaint.NodeElemStyle.paintPrimitive(NodeElemStyle.java:237)
at org.openstreetmap.josm.data.osm.visitor.paint.StyledMapRenderer$StyleCollector.drawAll(StyledMapRenderer.java:212)
at org.openstreetmap.josm.data.osm.visitor.paint.StyledMapRenderer.render(StyledMapRenderer.java:1397)
at org.openstreetmap.josm.gui.layer.OsmDataLayer.paint(OsmDataLayer.java:317)
at org.openstreetmap.josm.gui.MapView.paintLayer(MapView.java:503)
at org.openstreetmap.josm.gui.MapView.paint(MapView.java:563)
at javax.swing.JComponent.paintChildren(JComponent.java:862)
at javax.swing.JComponent.paint(JComponent.java:1038)
at javax.swing.JComponent.paintToOffscreen(JComponent.java:5124)
at javax.swing.BufferStrategyPaintManager.paint(BufferStrategyPaintManager.java:278)
at javax.swing.RepaintManager.paint(RepaintManager.java:1224)
at javax.swing.JComponent._paintImmediately(JComponent.java:5072)
at javax.swing.JComponent.paintImmediately(JComponent.java:4882)
at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:785)
at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:713)
at javax.swing.RepaintManager.seqPaintDirtyRegions(RepaintManager.java:693)
at javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(SystemEventQueueUtilities.java:125)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)

Attachments (0)

Change History (1)

comment:1 Changed 7 years ago by Don-vip

Resolution: fixed
Status: newclosed

In 5830/josm:

fix #8577 - Exception with empty SVG as image

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain team.
as The resolution will be set.
The resolution will be deleted.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.