Posts:
867
Registered:
13-Apr-2006
|
|
|
|
<ja:if exists="gpsLocation"> not working any more
Posted:
2 May 26, 10:02
|
|
|
Hi,
for many years I was using the following code <ja:if exists="originalDate"><i>${originalDate}</i></ja:if>
<ja:else>
<i>${fileDate}</i>
<ja:if test="${fileCategory}" value="video"> | <i>FPS: ${videoFPS} - Auflösung: ${videoWidth}×${videoHeight} - Dauer: ${videoDuration}</i></ja:if>
</ja:else>
<ja:if exists="gpsLocation"> | <a href="https://maps.google.com/?q=${gpsLocation}" class="mylink" rel="noreferrer nofollow"><abbr title="Google"><i class="fa fa-map-marker"> </i></abbr></a>
</ja:if>
<ja:if exists="gpsLocation"> | <%= (gpsLocation? '<a href="https://www.openstreetmap.org/?mlat=' + gpsLocation.split(',')[0] + '&mlon=' + gpsLocation.split(',')[1] + '&zoom=16#map=' + gpsLocation.split(',')[0] + '/' + gpsLocation.split(',')[1] + '" class="mylink" rel="noreferrer nofollow"><abbr title="OSM"><i class="fa fa-map-marker"> </i></abbr></a>' : '') %>
</ja:if>
<ja:if exists="gpsLocation"> | <%= (gpsLocation? '<a href="https://kart.finn.no/?lng=' + gpsLocation.split(',')[1] + '&lat=' + gpsLocation.split(',')[0] + '" class="mylink" rel="noreferrer nofollow"><abbr title="kart.finn.no"><i class="fa fa-map-marker"> </i></abbr></a>' : '') %>
</ja:if>
<ja:if exists="gpsLocation"> | <a href="https://www.windy.com/?${gpsLocation},16" class="mylink" rel="noreferrer nofollow"><abbr title="windy.com"><i class="fa fa-map-marker"> </i></abbr></a>
</ja:if>
<ja:if exists="meta">
<ja:if test="<%=meta.get("Gps.GPS Altitude") != null && !meta.get("Gps.GPS Altitude").equals("") %>"> | <i>Höhe: ${gpsAltitude}</i></ja:if>
<ja:if test="<%=meta.get("Iptc.Country/Primary Location Name") != null %>"> | <i>Land: <%=meta.get("Iptc.Country/Primary Location Name")%></i></ja:if>
<ja:if test="<%=meta.get("Iptc.City") != null %>"> | <i>Stadt: <%=meta.get("Iptc.City")%></i></ja:if>
<ja:if test="<%=meta.get("Iptc.Province/State") != null %>"> | <i>Bundesland: <%=meta.get("Iptc.Province/State")%></i></ja:if>
<ja:if test="<%=meta.get("Iptc.Sub-location") != null %>"> | <i>Ortsdetail: <%=meta.get("Iptc.Sub-location")%></i></ja:if>
</ja:if>
<ja:switch test="${rating}">
<ja:case value="1"> | <span style="color:gold;">★</span></ja:case>
<ja:case value="2"> | <span style="color:gold;">★★</span></ja:case>
<ja:case value="3"> | <span style="color:gold;">★★★</span></ja:case>
<ja:case value="4"> | <span style="color:gold;">★★★★</span></ja:case>
<ja:case value="5"> | <span style="color:gold;">★★★★★</span></ja:case>
<ja:default></ja:default>
</ja:switch>
<ja:if exists="fileTitle"> | ${fileTitle}</ja:if> | ${comment}
Most of the code still works fine. But the extraction of the gpsLocation fails. I don't get any links for Google, OpenStreetMap, Finn and Windy. I'm not sure if this is a Tiger issue, a core issue or my own fault.
Any ideas? Thanks in advance.
|
|
|
Posts:
1,511
Registered:
6-Sep-2005
|
|
|
|
Re: <ja:if exists="gpsLocation"> not working any more
Posted:
2 May 26, 10:35
in response to: MarkusD
|
|
|
|
If a picture has GPS coordinates (see Edit mode -> Location), then the ${gpsLocation} variable exists. Can you check if your pictures contain this data?
|
|
|
Posts:
8,335
Registered:
31-Jan-2006
|
|
|
|
Re: <ja:if exists="gpsLocation"> not working any more
Posted:
2 May 26, 10:56
in response to: Laza
|
|
|
Just as a quick sanity check, I tried one of my own skins, which uses similar logic, though in Groovy rather than in jAlbum scripting language, and it's working fine. Simplified code: if(exists.gpsLocation) {
gmLL = gpsLocation.split(",");
if(gmLL.length == 2 && !(0 == Float.parseFloat(gmLL[0]) && 0 == Float.parseFloat(gmLL[1]))) {
metaString += getGPSMeta(gpsLocationToDMS(gpsLocation), exifGPSLabel);
}
}
Maps are working in Tiger, as well.
ETA: Off-topic, but I check for zero coordinates because one user had a camera which, if its GPS was turned off, would plant the image at Null Island instead of leaving the variable empty. 
|
|
|
Posts:
867
Registered:
13-Apr-2006
|
|
|
|
Re: <ja:if exists="gpsLocation"> not working any more
Posted:
2 May 26, 11:20
in response to: Laza
|
|
|
|
|
If a picture has GPS coordinates (see Edit mode -> Location), then the ${gpsLocation} variable exists. Can you check if your pictures contain this data?
Yes, it does. See screenshot.
|
|
|
Posts:
3,982
Registered:
4-Aug-2006
|
|
|
|
Re: <ja:if exists="gpsLocation"> not working any more
Posted:
2 May 26, 12:26
in response to: MarkusD
|
|
|
If a picture has GPS coordinates (see Edit mode -> Location), then the ${gpsLocation} variable exists. Can you check if your pictures contain this data?
Yes, it does. See screenshot.
You have selected Settings > Advanced > Metadata > XMP as a source? (No gremlins got to your settings)
|
|
|
Posts:
867
Registered:
13-Apr-2006
|
|
|
|
Re: <ja:if exists="gpsLocation"> not working any more
Posted:
2 May 26, 12:30
in response to: RobM
|
|
|
|
|
You have selected Settings > Advanced > Metadata > XMP as a source? (No gremlins got to your settings)
Ahem, no, I think. I haven't changed settings for ages. Attached the jap file I used for years.
|
|
|
Posts:
3,982
Registered:
4-Aug-2006
|
|
|
|
Re: <ja:if exists="gpsLocation"> not working any more
Posted:
2 May 26, 12:43
in response to: MarkusD
|
|
|
You have selected Settings > Advanced > Metadata > XMP as a source? (No gremlins got to your settings)
Ahem, no, I think. I haven't changed settings for ages. Attached the jap file I used for years.
The setting for xmp is false, readXmp=false
|
|
|
Posts:
867
Registered:
13-Apr-2006
|
|
|
|
Re: <ja:if exists="gpsLocation"> not working any more
Posted:
2 May 26, 12:46
in response to: RobM
|
|
|
You are doing a lot more testing than needed. Just do one <ja:if exists="gpsLocation">
Then add all of the different map providers you want, without using the redundant <%= (gpsLocation? test
Rob, OK, this would be to optimise the code, for sure. Most of the code is not my own code, I asked for it many years here in the forum, because I don't know how this code works. Fact is, it worked until a few days ago pretty fine. And I have no idea what changed since. Does that exact code work for you, if I may ask?
|
|
|
Posts:
3,982
Registered:
4-Aug-2006
|
|
|
|
Re: <ja:if exists="gpsLocation"> not working any more
Posted:
2 May 26, 13:04
in response to: MarkusD
|
|
|
You are doing a lot more testing than needed. Just do one <ja:if exists="gpsLocation">
Then add all of the different map providers you want, without using the redundant <%= (gpsLocation? test
Rob, OK, this would be to optimise the code, for sure. Most of the code is not my own code, I asked for it many years here in the forum, because I don't know how this code works. Fact is, it worked until a few days ago pretty fine. And I have no idea what changed since. Does that exact code work for you, if I may ask?
I think this should work <ja:if exists="gpsLocation"> | <a href="https://maps.google.com/?q=${gpsLocation}" class="mylink" rel="noreferrer nofollow"><abbr title="Google"><i class="fa fa-map-marker"> </i></abbr></a>
| <%= '<a href="https://www.openstreetmap.org/?mlat=' + gpsLocation.split(',')[0] + '&mlon=' + gpsLocation.split(',')[1] + '&zoom=16#map=' + gpsLocation.split(',')[0] + '/' + gpsLocation.split(',')[1] + '" class="mylink" rel="noreferrer nofollow"><abbr title="OSM"><i class="fa fa-map-marker"> </i></abbr></a> | <a href="https://kart.finn.no/?lng=' + gpsLocation.split(',')[1] + '&lat=' + gpsLocation.split(',')[0] + '" class="mylink" rel="noreferrer nofollow"><abbr title="kart.finn.no"><i class="fa fa-map-marker"> </i></abbr></a>’ %> | <a href="https://www.windy.com/?${gpsLocation},16" class="mylink" rel="noreferrer nofollow"><abbr title="windy.com"><i class="fa fa-map-marker"> </i></abbr></a>
</ja:if>
|
|
|
Posts:
867
Registered:
13-Apr-2006
|
|
|
Posts:
8,335
Registered:
31-Jan-2006
|
|
|
|
Re: <ja:if exists="gpsLocation"> not working any more
Posted:
2 May 26, 14:41
in response to: MarkusD
|
|
|
|
Important question: Where are you using this code? Is this part of a title or comment, for example?
|
|
|
Posts:
867
Registered:
13-Apr-2006
|
|
|
|
Re: <ja:if exists="gpsLocation"> not working any more
Posted:
2 May 26, 14:45
in response to: JeffTucker
|
|
|
Its: skin.imageCaptionTemplate=<ja\:if exists\="originalDate"><i>${originalDate}</i></ja\:if>\n<ja\:else>\n <i>${fileDate}</i>\n <ja\:if test\="${fileCategory}" value\="video"> | <i>FPS\: ${videoFPS} - Aufl\u00F6sung\: ${videoWidth}\u00D7${videoHeight} - Dauer\: ${videoDuration}</i></ja\:if>\n</ja\:else>\n<ja\:if exists\="gpsLocation">\n | <a href\="https\://maps.google.com/?q\=${gpsLocation}" class\="mylink" rel\="noreferrer nofollow"><abbr title\="Google"><i class\="fa fa-map-marker"> </i></abbr></a>\n</ja\:if>\n<ja\:if exists\="gpsLocation">\n | <%\= (gpsLocation? '<a href\="https\://www.openstreetmap.org/?mlat\=' + gpsLocation.split(',')[0] + '&mlon\=' + gpsLocation.split(',')[1] + '&zoom\=16\#map\=' + gpsLocation.split(',')[0] + '/' + gpsLocation.split(',')[1] + '" class\="mylink" rel\="noreferrer nofollow"><abbr title\="OSM"><i class\="fa fa-map-marker"> </i></abbr></a>' \: '') %>\n</ja\:if>\n<ja\:if exists\="gpsLocation">\n | <%\= (gpsLocation? '<a href\="https\://kart.finn.no/?lng\=' + gpsLocation.split(',')[1] + '&lat\=' + gpsLocation.split(',')[0] + '" class\="mylink" rel\="noreferrer nofollow"><abbr title\="kart.finn.no"><i class\="fa fa-map-marker"> </i></abbr></a>' \: '') %>\n</ja\:if>\n<ja\:if exists\="gpsLocation">\n | <a href\="https\://www.windy.com/?${gpsLocation},16" class\="mylink" rel\="noreferrer nofollow"><abbr title\="windy.com"><i class\="fa fa-map-marker"> </i></abbr></a>\n</ja\:if>\n<ja\:if exists\="meta">\n <ja\:if test\="<%\=meta.get("Gps.GPS Altitude") \!\= null && \!meta.get("Gps.GPS Altitude").equals("") %>"> | <i>H\u00F6he\: ${gpsAltitude}</i></ja\:if>\n <ja\:if test\="<%\=meta.get("Iptc.Country/Primary Location Name") \!\= null %>"> | <i>Land\: <%\=meta.get("Iptc.Country/Primary Location Name")%></i></ja\:if>\n <ja\:if test\="<%\=meta.get("Iptc.City") \!\= null %>"> | <i>Stadt\: <%\=meta.get("Iptc.City")%></i></ja\:if>\n <ja\:if test\="<%\=meta.get("Iptc.Province/State") \!\= null %>"> | <i>Bundesland\: <%\=meta.get("Iptc.Province/State")%></i></ja\:if>\n <ja\:if test\="<%\=meta.get("Iptc.Sub-location") \!\= null %>"> | <i>Ortsdetail\: <%\=meta.get("Iptc.Sub-location")%></i></ja\:if>\n</ja\:if>\n<ja\:switch test\="${rating}">\n <ja\:case value\="1"> | <span style\="color\:gold;">★</span></ja\:case>\n <ja\:case value\="2"> | <span style\="color\:gold;">★★</span></ja\:case>\n <ja\:case value\="3"> | <span style\="color\:gold;">★★★</span></ja\:case>\n <ja\:case value\="4"> | <span style\="color\:gold;">★★★★</span></ja\:case>\n <ja\:case value\="5"> | <span style\="color\:gold;">★★★★★</span></ja\:case>\n <ja\:default></ja\:default>\n</ja\:switch>\n<ja\:if exists\="fileTitle"> | ${fileTitle}</ja\:if>\n | ${comment}
|
|
|
Posts:
8,335
Registered:
31-Jan-2006
|
|
|
|
Re: <ja:if exists="gpsLocation"> not working any more
Posted:
2 May 26, 15:00
in response to: MarkusD
|
|
|
OK, time for Debugging 101 again. Create a test project with just one image. In the Tiger settings, go to Lightbox > Caption > Caption template, choose [Custom], and enter just this: <ja:if exists="gpsLocation"> There is a map </ja:if>
Make the album.
For me, using the latest jAlbum and Tiger releases, I get a caption that reads, "There is a map." Do you?
|
|
|
Posts:
8,335
Registered:
31-Jan-2006
|
|
|
|
Re: <ja:if exists="gpsLocation"> not working any more
Posted:
2 May 26, 16:17
in response to: JeffTucker
|
|
|
|
One longshot: have you installed David's latest metadata package, metadata-extractor-2.20-main.jar? If you do, make sure to remove metadata-extractor-2.15.0.jar. Having both might do strange things.
|
|
|
|
Legend
|
|
Forum admins
|
|
Helpful Answer
|
|
Correct Answer
|
|