Modify

Opened 4 years ago

Closed 4 years ago

#15169 closed defect (worksforme)

*.svg image not working in preset (zip) file

Reported by: Allroads Owned by: Allroads
Priority: normal Milestone:
Component: External preset Version: tested
Keywords: icon zip Cc:

Description (last modified by Don-vip)

When I make a preset.xml file with a icon http://mijndev.openstreetmap.nl/~allroads/JOSM/Styles/images/bicycle-aqua.svg
http://mijndev.openstreetmap.nl/~allroads/JOSM/Styles/images/bicycle-aqua.svg

In the xml file are these two lines of code then the icon shows up in the menu.

<group name="Use sidepath"  icon="http://mijndev.openstreetmap.nl/~allroads/JOSM/Styles/images/bicycle-aqua.svg" >
<label icon="http://mijndev.openstreetmap.nl/~allroads/JOSM/Styles/images/bicycle-aqua.svg" icon_size="30" text="Set use_sidepath for bicycle." />

But when put the icon bicycle-aqua.svg in the same folder as the *.xml file and of this folder I make a zip file, then the icon is not visible in the menu.

<group name="Use sidepath"  icon="bicycle-aqua.svg" >
<label icon="bicycle-aqua.svg" icon_size="30" text="Set use_sidepath for bicycle." />

Is there a explanation?

Attachments (2)

JOSM use_sidepath.png (25.5 KB) - added by Allroads 4 years ago.
Errorlabel.png (10.8 KB) - added by Allroads 4 years ago.

Download all attachments as: .zip

Change History (18)

comment:1 Changed 4 years ago by Allroads

Summary: *.svg image not working in preset file*.svg image not working in preset (zip) file

comment:2 Changed 4 years ago by stoecker

Owner: changed from team to Allroads
Status: newneedinfo

Without the file it's hard to tell what error you made.

comment:3 Changed 4 years ago by Klumbumbus

maybe a caching problem?

comment:4 Changed 4 years ago by anonymous

I will test it again, let you all know the results.

Changed 4 years ago by Allroads

Attachment: JOSM use_sidepath.png added

comment:5 Changed 4 years ago by Allroads

I deleted all the files in the preference presets for use-sidepath.
Closed it.
Then open it again and set preference preset for this zipfile within a folder with the icons *.svg and the xml file.

http://mijndev.openstreetmap.nl/~allroads/JOSM/Presets/Test/Test-use_sidepath-icon.zip

Then open JOSM again, menu is there but not the icons in the preset.
I did this with a bat file.

Result in batfile:

2017-08-22 21:45:23.829 SEVERE: Failed to locate image 'sidepath.svg'
2017-08-22 21:45:23.831 SEVERE: Failed to locate image 'bicycle-aqua.svg'
2017-08-22 21:45:23.833 SEVERE: Failed to locate image 'mofa-aqua.svg'
2017-08-22 21:45:23.835 SEVERE: Failed to locate image 'moped-aqua.svg'
2017-08-22 21:45:23.837 SEVERE: Failed to locate image 'foot-aqua.svg'

Part of bug report

Last errors/warnings:
- E: Failed to locate image 'mofa-aqua.svg'
- E: Failed to locate image 'moped-aqua.svg'
- E: Failed to locate image 'foot-aqua.svg'
- E: Failed to locate image 'bicycle-aqua.svg'
- E: Failed to locate image 'sidepath.svg'

When I look further in the report i see this line.

mirror.<josm.cache>\images.http://mijndev.openstreetmap.nl/~allroads/JOSM/Styles/images/bicycle-aqua.svg=[1503004744688, <josm.cache>\images\mirror_http___mijndev.openstreetmap.nl__allroads_JOSM_Styles_images_bicycle-aqua.svg]

This is because I use the same images in the mappaintstyle. For moped mofa foot there is also such line.

The bicycle-aqua.svg used in the preset on the server is in the folder of the zipfile.

Then I used the use_sidepath.zip with only a xml in the folder, but the icons are url links.

http://mijndev.openstreetmap.nl/~allroads/JOSM/Presets/Test/use_sidepath.zip

This works fine.


Last edited 4 years ago by Allroads (previous) (diff)

comment:6 Changed 4 years ago by Allroads

What I further noticed is that in <label/> it is not possible to set nl.text="Zet access waarde use_sidepath"

I get a failure warning when starting JOSM.

Is this correct?

In this test version I deleted the nl.text=.

comment:7 Changed 4 years ago by Klumbumbus

In http://mijndev.openstreetmap.nl/~allroads/JOSM/Presets/Test/Test-use_sidepath-icon.zip there is a folder and in this folder are your xml and svg files. So either put all your files directly in the zip file without the extra folder or add the folder path for the icons in the xml, i.e. icon="Test-use_sidepath-icon/sidepath.svg"

(I didn't check but I think that should solve the problem.)

comment:8 in reply to:  6 Changed 4 years ago by Klumbumbus

Replying to Allroads:

What I further noticed is that in <label/> it is not possible to set nl.text="Zet access waarde use_sidepath"

I get a failure warning when starting JOSM.

Is this correct?

No, that should work fine.

comment:9 Changed 4 years ago by Allroads

Yes, folder with xml and svg.

I understand what you mean. I try it.

And I try one label line with nl.text.

Later.

Changed 4 years ago by Allroads

Attachment: Errorlabel.png added

comment:10 Changed 4 years ago by Allroads

Label:
I used the file NL-fiets.zip
Then I got this error message.

I solved the problem to nl.text in de labelline
Saved it, shut down JOSM, now also shut down PC, start all again.
NL-fiets.zip give still this error, but de problem is solved, changed the name to NL-fiets2.zip
Then I do not get this error. All work well.
Should have something to do with cache and filename NL-fiets.zip
I like to use this name.
Is this a bug?
What I expected is that if I change the file correctly and start over, JOSM does control the new written/saved file.
Now getting the same error (false), this is confusing and I took the wrong conclusion: nl.text not working in label.

comment:11 in reply to:  10 Changed 4 years ago by stoecker

Replying to Allroads:

Saved it, shut down JOSM, now also shut down PC, start all again.
NL-fiets.zip give still this error, but de problem is solved, changed the name to NL-fiets2.zip
Then I do not get this error. All work well.
Should have something to do with cache and filename NL-fiets.zip
I like to use this name.
Is this a bug?

If you use a local file (URL starts with file:) it should not happen.

If you load a remote file it's not a bug, but a feature (called caching :-). To reduce network load remote files are only downloaded sometimes. That has some drawbacks, but is currently the best for the majority of users and usecases.

To circumvent cache during development there are some solutions:

  • Delete contents of JOSM cache directory (~/.josm/cache for UNIX, somewhere in home directory for Windows) before starting JOSM
  • Delete (all) "mirror." keys in expert preferences and restart
  • Rename file or path each time you change something :-)

comment:12 Changed 4 years ago by stoecker

P.S. Don't ignore the last option. I assume that already adding a dummy parameter to a URL should work. e.g. url...xml?dummy=1 and then counting up each time you change it. The server ignores the dummy, but JOSM sees another URL each time.

comment:13 Changed 4 years ago by Allroads

Thanks,

The file was on the server mijndev.openstreetmap.nl/~allroads/JOSM/Presets/

comment:14 Changed 4 years ago by Don-vip

Description: modified (diff)

comment:15 Changed 4 years ago by Klumbumbus

See also wiki:Presets#UpdatingpresetsinJOSM how to update Presets within JOSM

comment:16 Changed 4 years ago by stoecker

Resolution: worksforme
Status: needinfoclosed

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Allroads.
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.