Modify

Opened 10 years ago

Closed 10 years ago

Last modified 7 years ago

#11510 closed defect (worksforme)

Custom icons in presets don't show up

Reported by: riiga_92@… Owned by: riiga_92@…
Priority: normal Milestone:
Component: Core Version:
Keywords: template_report Cc: stoecker

Description (last modified by Don-vip)

What steps will reproduce the problem?

  1. Create a basic preset with one or many custom icons
  2. Add the preset to JOSM (and restart)
  3. Use the created preset from the preset menu

What is the expected result?

New set of items with the specified icon (from the XML)

What happens instead?

No custom icons show up, only those already in JOSM (internal resources)

Please provide any additional information below. Attach a screenshot if possible.

When run from a terminal, this is the output:

C:\Program Files (x86)\JOSM>java -jar josm-tested.jar
ERROR: Failed to locate image '30.png'
WARNING: Could not get presets icon 30.png
ERROR: Failed to locate image '40.png'
WARNING: Could not get presets icon 40.png
ERROR: Failed to locate image 'maxspeed_icon.svg'
ERROR: Failed to locate image '50.png'
WARNING: Could not get presets icon 50.png
WARNING: Mappaint style "standard" (Maxspeed) icon "maxspeed_icon.svg" not found
.
ERROR: Failed to locate image '60.png'
WARNING: Could not get presets icon 60.png
ERROR: Failed to locate image '70.png'
WARNING: Could not get presets icon 70.png
ERROR: Failed to locate image '80.png'
WARNING: Could not get presets icon 80.png
ERROR: Failed to locate image '90.png'
WARNING: Could not get presets icon 90.png
ERROR: Failed to locate image '100.png'
WARNING: Could not get presets icon 100.png
ERROR: Failed to locate image '110.png'
WARNING: Could not get presets icon 110.png
ERROR: Failed to locate image '120.png'
WARNING: Could not get presets icon 120.png
ERROR: Failed to locate image '130.png'
WARNING: Could not get presets icon 130.png
INFO: loading plugin 'turnrestrictions' (version 31034)
INFO: loading plugin 'PicLayer' (version 31114)

where you can see that the icons failed to load, despite it saying on the JOSM wiki that icons are stored/read relative to the path of the XML for the mapstyle/preset. Using absolute paths in the XML file solved this problem, but that is not a good solution. You can also see that the Maxspeed mapstyle failed to load its icon, which is strange considering I've made no changes whatsoever to it and installed it from the list of mapstyles in JOSM.

A typical entry in my custom preset looks like this:

<item name="30 km/h" icon="30.png" type="way,closedway">
    <key key="maxspeed" value="30" />
</item>

where the icon 30.png is located in the same folder as the preset XML file.

Revision: 8339
Repository Root: http://josm.openstreetmap.de/svn
Relative URL: ^/trunk
Last Changed Author: stoecker
Last Changed Date: 2015-05-07 17:30:43 +0200 (Thu, 07 May 2015)
Build-Date: 2015-05-08 01:31:23
URL: http://josm.openstreetmap.de/svn/trunk
Repository UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b
Last Changed Rev: 8339

Identification: JOSM/1.5 (8339 en) Windows 7 64-Bit
Memory Usage: 382 MB / 3634 MB (135 MB allocated, but free)
Java version: 1.8.0_31, Oracle Corporation, Java HotSpot(TM) 64-Bit Server VM

Plugins:
- PicLayer (31114)
- turnrestrictions (31034)

Last errors/warnings:
- W: Could not get presets icon 120.png
- E: Failed to locate image '130.png'
- W: Could not get presets icon 130.png
- E: Failed to locate image 'maxspeed_icon.svg'
- W: Mappaint style "standard" (Maxspeed) icon "maxspeed_icon.svg" not found.

Attachments (0)

Change History (19)

comment:1 by Klumbumbus, 10 years ago

Btw: do you know that the JOSM default style renders the actual value of maxspeed as maxspeed sign?

comment:2 by Don-vip, 10 years ago

Description: modified (diff)

comment:3 by Don-vip, 10 years ago

Owner: changed from team to riiga_92@…
Status: newneedinfo

Can you please try to force an update of map paint styles to see if it solves the issue with maxspeed icon?

in reply to:  3 comment:4 by riiga_92@…, 10 years ago

Replying to Don-vip:

Can you please try to force an update of map paint styles to see if it solves the issue with maxspeed icon?

How? Right-clicking the map paint style gives a greyed-out "Reload from file". The only update button in the settings are for the plugins, not map paint styles.

comment:5 by Don-vip, 10 years ago

Here: Help/Preferences/Map#MapPaintStyles (the button with blue arrows)

in reply to:  5 ; comment:6 by Don-vip, 10 years ago

Replying to Don-vip:

Here: Help/Preferences/Map#MapPaintStyles (the button with blue arrows)

... or not. This is not yet implemented (see #8933). You can delete the file in cache folder and restart JOSM.

in reply to:  6 comment:7 by riiga_92@…, 10 years ago

Replying to Don-vip:

... or not. This is not yet implemented (see #8933). You can delete the file in cache folder and restart JOSM.

Tried that now, the maxspeed icon is still missing and it gives me the same error in the log.

comment:8 by Don-vip, 10 years ago

Cc: stoecker added

Mmmm strange. I'm summoning Dirk, I don't know what's happening here.

comment:9 by stoecker, 10 years ago

In the past you could place icons in the icon path of JOSM and in a zip together with the XML. I'm not aware that somebody changed it to the path where the XML is loaded from. I'd suggest to zip everything into a zip file.

in reply to:  9 comment:10 by riiga_92@…, 10 years ago

Replying to stoecker:

In the past you could place icons in the icon path of JOSM and in a zip together with the XML. I'm not aware that somebody changed it to the path where the XML is loaded from. I'd suggest to zip everything into a zip file.

Thanks, that did the trick for my custom preset. The maxspeed style icon still fails though, but that is probably something wrong by the authors of that style.

I guess you also should clarify the icon handling on the wiki, as "Use a path relative to your local style file." is very ambiguous, since it talks nothing about them having to be zipped.

comment:11 by Klumbumbus, 10 years ago

according WARNING: Mappaint style "standard" (Maxspeed) icon "maxspeed_icon.svg" not found I have such a missing icon and a warning aswell WARNUNG: Mappaint style "standard" (FIXME Highlight Warnings) icon "error_small.png" not found.

Sadly I cannot find the ticket anymore, but some month ago Dirk made some icon related changes. As a result icons, which were included from internal source before, were added to the zip of the style wiki page. (https://josm.openstreetmap.de/wiki/Styles/Fixme?sfp_email=&sfph_mail=&action=diff&version=8&old_version=7). But the cache in JOSM does not update automatically, so all users would need to manually clear their cache, which is not an option. Dirk said something about a server job he would perform to fix this. I don't know whats the status of this. I did not clear cache intenionally to see if my 'fixme' icon comes back some day, but it did not yet.

comment:12 by stoecker, 10 years ago

Since r8100 JOSM should update old links automatically.
Please tell me what presets URLS you have? Entry <maps key='mappaint.style.entries'> and "taggingpreset.entries" in preferences file.

in reply to:  12 comment:13 by riiga_92@…, 10 years ago

Replying to stoecker:

Since r8100 JOSM should update old links automatically.
Please tell me what presets URLS you have? Entry <maps key='mappaint.style.entries'> and "taggingpreset.entries" in preferences file.

Not sure if directed at me or Klumbumbus, but here's what I have (apart from standard ones):

<maps key='mappaint.style.entries'>
    <tag key='title' value='Maxspeed'/>
    <tag key='url' value='https://josm.openstreetmap.de/josmfile?page=Styles/Maxspeed&amp;style'/>
    ---
    <tag key='title' value='Highway Nodes'/>
    <tag key='url' value='https://josm.openstreetmap.de/josmfile?page=Styles/Highway_Nodes&amp;zip=1'/>
    ---
    <tag key='title' value='Coloured Streets'/>
    <tag key='url' value='https://josm.openstreetmap.de/josmfile?page=Styles/Coloured_Streets&amp;zip=1'/>
    ---
    <tag key='title' value='Cycleways'/>
    <tag key='url' value='https://josm.openstreetmap.de/josmfile?page=Styles/Cycleways&amp;zip=1'/>
    ---
    <tag key='title' value='FIXME Highlight Warnings'/>
    <tag key='url' value='https://josm.openstreetmap.de/josmfile?page=Styles/Fixme&amp;zip=1'/>
    ---
    <tag key='title' value='Layer checker'/>
    <tag key='url' value='https://josm.openstreetmap.de/josmfile?page=Styles/LayerChecker&amp;zip=1'/>
</maps>

and for presets only my custom one which is now working:

<maps key='taggingpreset.entries'>
    <tag key='title' value='QuickSets'/>
    <tag key='url' value='C:\Program Files (x86)\JOSM\QuickSets\QuickSets.zip'/>
</maps>

comment:14 by stoecker, 10 years ago

Resolution: fixed
Status: needinfoclosed

Hmm, somehow you managed to skip the update for one link. Either remove the Maxspeed style and readd it or replace "style" at the end of the URL with "zip=1".

comment:15 by Klumbumbus, 10 years ago

(I removed my local style file entries)
I do not have zip for 7 wiki hosted styles:

<maps key='mappaint.style.entries'>
    <map>
      <tag key='active' value='true'/>
      <tag key='title' value='JOSM Standard (MapCSS)'/>
      <tag key='ptoken' value='standard'/>
      <tag key='url' value='resource://styles/standard/elemstyles.mapcss'/>
    </map>
    <map>
      <tag key='active' value='false'/>
      <tag key='title' value='Oberflächenbeschaffenheit'/>
      <tag key='url' value='http://josm.openstreetmap.de/josmfile?page=Styles/Surface&amp;style'/>
    </map>
    <map>
      <tag key='active' value='false'/>
      <tag key='title' value='Parkstreifen'/>
      <tag key='url' value='http://josm.openstreetmap.de/josmfile?page=Styles/ParkingLanes&amp;style'/>
    </map>
    <map>
      <tag key='active' value='false'/>
      <tag key='title' value='Gehwege'/>
      <tag key='url' value='http://josm.openstreetmap.de/josmfile?page=Styles/Sidewalks&amp;style'/>
    </map>
    <map>
      <tag key='active' value='false'/>
      <tag key='title' value='Radwege und -spuren'/>
      <tag key='url' value='http://josm.openstreetmap.de/josmfile?page=Styles/Cycleways&amp;style'/>
    </map>
    <map>
      <tag key='active' value='false'/>
      <tag key='title' value='OSMC Hiking'/>
      <tag key='url' value='https://josm.openstreetmap.de/josmfile?page=Styles/Osmc&amp;style'/>
    </map>
    <map>
      <tag key='active' value='false'/>
      <tag key='title' value='FIXME Highlight Warnings'/>
      <tag key='url' value='https://josm.openstreetmap.de/josmfile?page=Styles/Fixme&amp;style'/>
    </map>
    <map>
      <tag key='active' value='false'/>
      <tag key='title' value='Wheelchair Routing Attributes'/>
      <tag key='url' value='https://raw.githubusercontent.com/species/josm-preset-wheelchair/master/sidewalks_kerbs.mapcss'/>
    </map>
    <map>
      <tag key='active' value='false'/>
      <tag key='title' value='Lit Objects'/>
      <tag key='url' value='https://josm.openstreetmap.de/josmfile?page=Styles/LitObjects&amp;zip=1'/>
    </map>
    <map>
      <tag key='active' value='false'/>
      <tag key='title' value='Lit'/>
      <tag key='url' value='https://josm.openstreetmap.de/josmfile?page=Styles/Lit&amp;style'/>
    </map>
    <map>
      <tag key='active' value='false'/>
      <tag key='title' value='Lane and road attributes'/>
      <tag key='url' value='https://josm.openstreetmap.de/josmfile?page=Styles/Lane_and_Road_Attributes&amp;zip=1'/>
    </map>
    <map>
      <tag key='active' value='false'/>
      <tag key='title' value='sac_scale'/>
      <tag key='url' value='https://josm.openstreetmap.de/josmfile?page=Styles/sac_scale&amp;zip=1'/>
    </map>
    <map>
      <tag key='active' value='true'/>
      <tag key='title' value='Coloured Streets'/>
      <tag key='url' value='https://josm.openstreetmap.de/josmfile?page=Styles/Coloured_Streets&amp;zip=1'/>
    </map>
    <map>
      <tag key='active' value='false'/>
      <tag key='title' value='ZeigeID'/>
      <tag key='url' value='https://josm.openstreetmap.de/josmfile?page=Styles/ShowID&amp;zip=1'/>
    </map>
    <map>
      <tag key='active' value='false'/>
      <tag key='title' value='Maxspeed'/>
      <tag key='url' value='https://josm.openstreetmap.de/josmfile?page=Styles/Maxspeed&amp;zip=1'/>
    </map>
    <map>
      <tag key='active' value='false'/>
      <tag key='title' value='Layer checker'/>
      <tag key='url' value='https://josm.openstreetmap.de/josmfile?page=Styles/LayerChecker&amp;zip=1'/>
    </map>
    <map>
      <tag key='active' value='false'/>
      <tag key='title' value='Coloured Buildings.de'/>
      <tag key='url' value='https://josm.openstreetmap.de/josmfile?page=Styles/Coloured_buildings&amp;zip=1'/>
    </map>
    <map>
      <tag key='active' value='false'/>
      <tag key='title' value='Geänderte Objekte'/>
      <tag key='url' value='https://josm.openstreetmap.de/josmfile?page=Styles/Modified&amp;zip=1'/>
    </map>
    <map>
      <tag key='active' value='false'/>
      <tag key='title' value='Mapnik (true)'/>
      <tag key='url' value='https://github.com/bastik/mapcss-tools/raw/osm/mapnik2mapcss/osm-results/mapnik.zip'/>
    </map>
    <map>
      <tag key='active' value='false'/>
      <tag key='title' value='JOSM Standard (XML; alte version, veraltet)'/>
      <tag key='url' value='https://josm.openstreetmap.de/josmfile?page=Styles/LegacyStandard&amp;zip=1'/>
    </map>
  </maps>

comment:16 by Klumbumbus, 10 years ago

missing style icon warnings also in #11448, #11478, #11301, #11155

(https://josm.openstreetmap.de/ticket/10581#comment:22 was the comment I was serching for)

comment:17 by Don-vip, 10 years ago

Resolution: fixedworksforme

comment:18 by krza, 8 years ago

So do I understand it correctly that I really need to put everything into a zip? This would be quite annoying when developing presets because I always need to zip everything again after saving something. Very bad solution.

Id took me quite a while to find out that relative paths don´t work but absolute ones do. It was even more strange because it works fine with map styles - there you can apply all pathes relatively, so in connection with the mentioned Wiki (which still does not say anything about zipping) I could not expect that it doesn´t work.

Conclusion: "Real" relative pathes should really be implemented asap.

Kristian

in reply to:  18 comment:19 by Klumbumbus, 8 years ago

Replying to krza:

So do I understand it correctly that I really need to put everything into a zip?

No, you also can add your icon directory to the Presets preferences page and then you can use icon paths in your preset relative to the specified folder.

I added a hint: https://josm.openstreetmap.de/wiki/Styles?sfp_email=&sfph_mail=&action=diff&version=138&old_version=136&sfp_email=&sfph_mail=

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain riiga_92@….
as The resolution will be set.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.