Opened 3 years ago
Last modified 22 months ago
#18866 new enhancement
Transform Potlatch2 mappaint style icons to SVG
Reported by: | Stereo | Owned by: | team |
---|---|---|---|
Priority: | normal | Milestone: | Longterm |
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 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 (43)
comment:2 Changed 3 years ago by
Component: | Core → Internal mappaint style |
---|
comment:3 Changed 3 years ago by
Summary: | Transform Potlatch2 theme icons to SVG → Transform 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 3 years ago by
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 3 years ago by
Keywords: | svg icon potlatch2 added |
---|
comment:6 follow-up: 7 Changed 3 years ago by
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 Changed 3 years ago by
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:9 Changed 3 years ago by
Component: | Internal mappaint style → Core |
---|
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 3 years ago by
Status: | assigned → new |
---|
comment:11 Changed 3 years ago by
I'd say the main reason is historical. There is no need to have it internal.
comment:13 Changed 2 years ago by
Btw, there will probably be Potlatch3: https://forum.openstreetmap.org/viewtopic.php?pid=799795#p799795
comment:15 follow-up: 16 Changed 2 years ago by
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 Changed 2 years ago by
comment:17 Changed 2 years ago by
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:18 Changed 2 years ago by
comment:19 Changed 2 years ago by
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 follow-up: 21 Changed 2 years ago by
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 Changed 2 years ago by
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.
comment:22 Changed 2 years ago by
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 2 years ago by
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 2 years ago by
Another thing: at least one external styles uses the core potlatch pngs: wiki:/Styles/PowerMapping
comment:25 Changed 2 years ago by
Three matches for n.16.png
:
comment:27 follow-up: 29 Changed 2 years ago by
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 2 years ago by
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 Changed 2 years ago by
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 2 years ago by
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 2 years ago by
Cc: | pierzen added |
---|
Adding Pierzen, the author of the Tsunami style, in CC.
comment:32 Changed 2 years ago by
I reuploaded the original file with updated description and with (NOZIP)
https://josm.openstreetmap.de/attachment/wiki/Styles/JP-Tsunami/Icons_JP-Tsunami.zip
comment:34 Changed 2 years ago by
Milestone: | 20.10 → 20.11 |
---|
comment:36 Changed 2 years ago by
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:38 Changed 2 years ago by
Milestone: | 20.12 → 21.01 |
---|
comment:39 Changed 2 years ago by
Milestone: | 21.01 → 21.02 |
---|
comment:41 Changed 23 months ago by
Milestone: | 21.03 |
---|
comment:42 Changed 23 months ago by
Milestone: | → 21.04 |
---|
comment:43 Changed 22 months ago by
Milestone: | 21.04 → Longterm |
---|
In https://josm.openstreetmap.de/ticket/15240#comment:99 , stoecker writes: