Modify

Opened 11 months ago

Last modified 3 weeks ago

#18866 new enhancement

Transform Potlatch2 mappaint style icons to SVG

Reported by: Stereo Owned by: team
Priority: normal Milestone: 21.01
Component: Core Version:
Keywords: svg icon potlatch2 Cc:

Description

Since we have an icon scaling on hidpi screens now (ticket:9995#comment:110) it would be nice to transform all icons to svg. Preset icons are already all svg (#13357) and GUI icons are making great progress (#15240).

https://www.sjjb.co.uk/mapicons/contactsheet has a lot of icons that we use in the potlatch2 theme - https://www.sjjb.co.uk/mapicons/svg/accommodation/alpinehut.svg could replace source:trunk/resources/images/icons/accommodation_alpinehut.n.16.png resources/images/icons/accommodation_alpinehut.n.16.png etc.

http://osm-icons.org/wiki/Icons has more of the same icons

Attachments (0)

Change History (38)

comment:1 Changed 11 months ago by Stereo

In https://josm.openstreetmap.de/ticket/15240#comment:99 , stoecker writes:

A zip file with the new images and a small shell script doing the necessary svn commands would probable be the best idea (old icons moved with "svn mv" to nodist directory).

Last edited 3 months ago by Stereo (previous) (diff)

comment:2 Changed 11 months ago by Klumbumbus

Component: CoreInternal mappaint style

comment:3 Changed 11 months ago by Klumbumbus

Summary: Transform Potlatch2 theme icons to SVGTransform Potlatch2 mappaint style icons to SVG

Before changing the icons in JOSM maybe first ask the P2 guys if they are interested in switching to svg. Then the change can be made there first.

comment:4 Changed 11 months ago by Stereo

Yeah, I notice that the P2 style hasn't been pulled since 2016, and that the patches could, in some cases, be backported.

I'll check with Richard.

comment:5 Changed 11 months ago by Don-vip

Keywords: svg icon potlatch2 added

comment:6 Changed 10 months ago by Stereo

Richard has no plans to convert the Potlatch2 style to SVG since Flash doesn't support it. I didn't get the feeling that he was planning any changes on it, especially considering Flash's imminent demise.

Are there any reasons other than historical for which the Potlatch2 style is built-in and not a custom style like the rest of the other styles?

comment:7 in reply to:  6 Changed 10 months ago by Klumbumbus

Replying to Stereo:

Are there any reasons other than historical for which the Potlatch2 style is built-in and not a custom style like the rest of the other styles?

Probably because it needs to be patched to work in JOSM.

comment:8 Changed 10 months ago by Don-vip

Also, the P2 style is a general style, not a feature-specific one.

comment:9 Changed 10 months ago by Stereo

Component: Internal mappaint styleCore

Since Richard doesn't intend to work on it anymore, (one day) I will take the patched version, integrate any changes done upstream since, change the icons to vectors and host it on the wiki here, like https://josm.openstreetmap.de/wiki/Styles/iD

comment:10 Changed 8 months ago by anonymous

Status: assignednew

comment:11 Changed 8 months ago by stoecker

I'd say the main reason is historical. There is no need to have it internal.

comment:12 Changed 4 months ago by Klumbumbus

In 17016/josm:

see #18866 - Update to latest and probably last version of Potlatch2 mappaint style

comment:13 Changed 4 months ago by Klumbumbus

comment:14 Changed 4 months ago by Klumbumbus

In 17022/josm:

comment:15 Changed 4 months ago by GerdP

I have a question reg. the icon names: Is the .svg extension wanted? My understanding was that ImageProvider should control what kind of format it uses if there are alternatives.

comment:16 in reply to:  15 Changed 4 months ago by Klumbumbus

Replying to GerdP:

I have a question reg. the icon names: Is the .svg extension wanted? My understanding was that ImageProvider should control what kind of format it uses if there are alternatives.

--> #19788

comment:17 Changed 3 months ago by Stereo

https://josm.openstreetmap.de/wiki/Styles/Potlatch2

The built-in P2 style can now be deleted. There should probably be a note in the next motd to tell people to activate the vectorised style.

comment:19 Changed 3 months ago by Klumbumbus

JOSM can't render the bakery icon:

2020-10-29 20:43:31.387 WARNING: Could not load SVG svgSalamander:/icons/shopping_bakery.n.svg
java.lang.NumberFormatException: For input string: "l"
	at sun.misc.FloatingDecimal.readJavaFormatString(Unknown Source)
	at sun.misc.FloatingDecimal.parseFloat(Unknown Source)
	at java.lang.Float.parseFloat(Unknown Source)
	at com.kitfox.svg.SVGElement.nextFloat(SVGElement.java:687)
	at com.kitfox.svg.SVGElement.parsePathList(SVGElement.java:758)
	at com.kitfox.svg.SVGElement.buildPath(SVGElement.java:811)
	at com.kitfox.svg.Path.build(Path.java:87)
	at com.kitfox.svg.Path.updateTime(Path.java:151)
	at com.kitfox.svg.Group.updateTime(Group.java:313)
	at com.kitfox.svg.Group.updateTime(Group.java:313)
	at com.kitfox.svg.SVGRoot.updateTime(SVGRoot.java:409)
	at com.kitfox.svg.SVGDiagram.updateTime(SVGDiagram.java:243)
	at com.kitfox.svg.SVGUniverse.loadSVG(SVGUniverse.java:616)
	at com.kitfox.svg.SVGUniverse.loadSVG(SVGUniverse.java:499)
	at com.kitfox.svg.SVGUniverse.loadSVG(SVGUniverse.java:484)
	at org.openstreetmap.josm.tools.ImageProvider.getIfAvailableZip(ImageProvider.java:1124)
	at org.openstreetmap.josm.tools.ImageProvider.getIfAvailableImpl(ImageProvider.java:937)
	at org.openstreetmap.josm.tools.ImageProvider.getResource(ImageProvider.java:712)
	at org.openstreetmap.josm.tools.ImageProvider.getResourceAsync(ImageProvider.java:747)
	at org.openstreetmap.josm.gui.mappaint.styleelement.MapImage.load(MapImage.java:175)
	at org.openstreetmap.josm.gui.mappaint.styleelement.MapImage.loadImage(MapImage.java:184)
	at org.openstreetmap.josm.gui.mappaint.styleelement.MapImage.getImage(MapImage.java:158)
	at org.openstreetmap.josm.gui.mappaint.styleelement.MapImage.getWidth(MapImage.java:230)
	at org.openstreetmap.josm.data.osm.visitor.paint.StyledMapRenderer.drawNodeIcon(StyledMapRenderer.java:791)
	at org.openstreetmap.josm.gui.mappaint.styleelement.NodeElement.paintPrimitive(NodeElement.java:260)
	at org.openstreetmap.josm.data.osm.visitor.paint.StyledMapRenderer$StyleRecord.paintPrimitive(StyledMapRenderer.java:226)
	at org.openstreetmap.josm.data.osm.visitor.paint.StyledMapRenderer.paintRecord(StyledMapRenderer.java:1713)
	at org.openstreetmap.josm.data.osm.visitor.paint.StyledMapRenderer.paintWithLock(StyledMapRenderer.java:1695)
	at org.openstreetmap.josm.data.osm.visitor.paint.StyledMapRenderer.render(StyledMapRenderer.java:1644)
	at org.openstreetmap.josm.gui.layer.OsmDataLayer.paint(OsmDataLayer.java:543)
	at org.openstreetmap.josm.gui.layer.AbstractMapViewPaintable$CompatibilityModeLayerPainter.paint(AbstractMapViewPaintable.java:27)
	at org.openstreetmap.josm.gui.MapView.paintLayer(MapView.java:466)
	at org.openstreetmap.josm.gui.MapView.drawMapContent(MapView.java:581)
	at org.openstreetmap.josm.gui.MapView.paint(MapView.java:488)
	at javax.swing.JComponent.paintChildren(Unknown Source)
	at javax.swing.JComponent.paint(Unknown Source)
	at javax.swing.JComponent.paintChildren(Unknown Source)
	at javax.swing.JSplitPane.paintChildren(Unknown Source)
	at javax.swing.JComponent.paint(Unknown Source)
	at javax.swing.JComponent.paintChildren(Unknown Source)
	at javax.swing.JComponent.paint(Unknown Source)
	at javax.swing.JComponent.paintChildren(Unknown Source)
	at javax.swing.JComponent.paint(Unknown Source)
	at javax.swing.JComponent.paintChildren(Unknown Source)
	at javax.swing.JComponent.paint(Unknown Source)
	at javax.swing.JComponent.paintChildren(Unknown Source)
	at javax.swing.JComponent.paint(Unknown Source)
	at javax.swing.JLayeredPane.paint(Unknown Source)
	at javax.swing.JComponent.paintChildren(Unknown Source)
	at javax.swing.JComponent.paintToOffscreen(Unknown Source)
	at javax.swing.RepaintManager$PaintManager.paintDoubleBuffered(Unknown Source)
	at javax.swing.RepaintManager$PaintManager.paint(Unknown Source)
	at javax.swing.RepaintManager.paint(Unknown Source)
	at javax.swing.JComponent.paint(Unknown Source)
	at java.awt.GraphicsCallback$PaintCallback.run(Unknown Source)
	at sun.awt.SunGraphicsCallback.runOneComponent(Unknown Source)
	at sun.awt.SunGraphicsCallback.runComponents(Unknown Source)
	at java.awt.Container.paint(Unknown Source)
	at java.awt.Window.paint(Unknown Source)
	at javax.swing.RepaintManager$4.run(Unknown Source)
	at javax.swing.RepaintManager$4.run(Unknown Source)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
	at javax.swing.RepaintManager.paintDirtyRegions(Unknown Source)
	at javax.swing.RepaintManager.paintDirtyRegions(Unknown Source)
	at javax.swing.RepaintManager.prePaintDirtyRegions(Unknown Source)
	at javax.swing.RepaintManager.access$1200(Unknown Source)
	at javax.swing.RepaintManager$ProcessingRunnable.run(Unknown Source)
	at java.awt.event.InvocationEvent.dispatch(Unknown Source)
	at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
	at java.awt.EventQueue.access$500(Unknown Source)
	at java.awt.EventQueue$3.run(Unknown Source)
	at java.awt.EventQueue$3.run(Unknown Source)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
	at java.awt.EventQueue.dispatchEvent(Unknown Source)
	at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
	at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
	at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
	at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
	at java.awt.EventDispatchThread.run(Unknown Source)

2020-10-29 20:43:31.392 SEVERE: Failed to locate image 'icons/shopping_bakery.n.svg'
2020-10-29 20:44:07.717 SEVERE: createImageFromSvg: svgSalamander:/icons/shopping_bakery.n.svg java.awt.Dimension[width=-1,height=-1] sourceWidth=0 sourceHeight=0

comment:20 Changed 3 months ago by Stereo

Wow, well spotted. Even the original didn't work. I fixed it by re-saving the icon, then re-minifying it.

Do you have a test script to build .osm files, or did you test them all by hand?

Thanks!

comment:21 in reply to:  20 Changed 3 months ago by Klumbumbus

Replying to Stereo:

Do you have a test script to build .osm files, or did you test them all by hand?

No, if there is a problem with the style then it has a exclamation mark on top of its icon. Then you can right click -> info and then is a hint in the Errors or Warnings tab.

wiki:/Help/Dialog/MapPaint#Info

Last edited 3 months ago by Klumbumbus (previous) (diff)

comment:22 Changed 3 months ago by Klumbumbus

Owner: changed from Stereo to team

Removing the old core Potlatch2 mappaint style requires some code to remove it from the users list of active styles.

comment:23 Changed 3 months ago by Stereo

Milestone: 20.10

If a message can be added to the MOTD, the built-in P2 style can be removed in 20.10.

comment:24 Changed 3 months ago by Klumbumbus

Another thing: at least one external styles uses the core potlatch pngs: wiki:/Styles/PowerMapping

comment:26 Changed 3 months ago by Klumbumbus

Good, they a pretty small. One could add the new svgs there too.

comment:27 Changed 3 months ago by Stereo

Done!

I don't have the permissions to delete, overwrite or update the old Icons_JP-Tsunami.zip​ attachment on https://josm.openstreetmap.de/wiki/Styles/JP-Tsunami - do you?

"You don't have permission to replace the attachment Icons_JP-Tsunami.zip. You can only replace your own attachments. Replacing other's attachments requires ATTACHMENT_DELETE permission."

comment:28 Changed 3 months ago by Stereo

So I guess we can now mv resources/images/icons resources/styles/standard/potlatch2.mapcss resources/images/dialogs/mappaint/pl2_small.svg nodist/?

comment:29 in reply to:  27 Changed 3 months ago by Klumbumbus

Replying to Stereo:

I don't have the permissions to delete, overwrite or update the old Icons_JP-Tsunami.zip​ attachment on https://josm.openstreetmap.de/wiki/Styles/JP-Tsunami - do you?

There are a lot less icons in Icons_JP-Tsunami.2.zip I guess you removed the unneeded ones? I think even if they are not used by the style atm it is better to keep them in the zip, else they are lost.

comment:30 Changed 3 months ago by Stereo

Yeah, I only kept the ones that were actually being used. I've also optimised the PNGs, saving a few KB.

I suppose the old zip can be renamed instead. I don't have the rights to do that either.

comment:31 Changed 3 months ago by Stereo

Cc: pierzen added

Adding Pierzen, the author of the Tsunami style, in CC.

comment:32 Changed 3 months ago by Klumbumbus

I reuploaded the original file with updated description and with (NOZIP)

https://josm.openstreetmap.de/attachment/wiki/Styles/JP-Tsunami/Icons_JP-Tsunami.zip

Last edited 3 months ago by Klumbumbus (previous) (diff)

comment:33 Changed 3 months ago by Stereo

Cc: pierzen removed

Perfect, removing PierZen then.

comment:34 Changed 3 months ago by Klumbumbus

Milestone: 20.1020.11

comment:35 Changed 2 months ago by Don-vip

Milestone: 20.1120.12

Milestone renamed

comment:36 Changed 2 months ago by Stereo

What remains to be done on this ticket is mv resources/images/icons resources/styles/standard/potlatch2.mapcss resources/images/dialogs/mappaint/pl2_small.svg nodist/

comment:37 Changed 2 months ago by Klumbumbus

comment:38 Changed 3 weeks ago by simon04

Milestone: 20.1221.01

Modify Ticket

Change Properties
Set your email in Preferences
Action
as new The owner will remain team.
as The resolution will be set.
to The owner will be changed from team to the specified user.
The owner will change to Stereo
as duplicate The resolution will be set to duplicate.The specified ticket will be cross-referenced with this ticket
The owner will be changed from team to anonymous.

Add Comment


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

 
Note: See TracTickets for help on using tickets.