Open m93a opened 2 months ago
In a session.jos file, the other layers can be specified by paths relative to the session file:
session.jos
<?xml version="1.0" encoding="utf-8"?> <josm-session version="0.1"> <layers active="1"> <layer index="1" name="data_layer.osm" type="osm-data" version="0.1" visible="true"> <file>./data.osm</file> </layer> <layer index="2" name="google_contours.osm" type="osm-data" version="0.1" visible="true"> <file>./contours.osm</file> </layer> </layers> </josm-session>
However, if I try to include a pic layer using a relative path:
<layer index="3" name="p69_001.png" type="piclayerImage" version="0.1" visible="true"> <piclayerImage> <file>./my_pic.png</file> <thumbnail>false</thumbnail> </piclayerImage> </layer>
I get an error:
The only way to get the image to load is by using a full absolute path. This ruins the portability of a session file that would otherwise work across different machines.
This is probably caused by this line:
entry.setFile(new File(attrElem.getTextContent()));
The file path should be resolved relative to the session file.
In a
session.jos
file, the other layers can be specified by paths relative to the session file:However, if I try to include a pic layer using a relative path:
I get an error:
The only way to get the image to load is by using a full absolute path. This ruins the portability of a session file that would otherwise work across different machines.