This question is answered. Helpful answers available: 0. Correct answers available: 1.


Permlink Replies: 54 - Pages: 4 [ Previous | 1 2 3 4 ] - Last Post: 8 May 26, 07:37 Last Post By: MarkusD
JeffTucker

Posts: 8,330
Registered: 31-Jan-2006
Re: <ja:if exists="gpsLocation"> not working any more
Posted: 4 May 26, 21:48   in response to: MarkusD in response to: MarkusD
 
  Click to reply to this thread Reply
I thrashed around with this, horribly puzzled, until I realized that this was being processed in Javascript, not Java (or Groovy), which is what I'm used to! Here's the replacement bit of code for Dauer - it splits the string at the first "dot," and uses the first chunk of it:
Dauer: <%=videoDuration.toString().split('.')[0]%>
JeffTucker

Posts: 8,330
Registered: 31-Jan-2006
Re: <ja:if exists="gpsLocation"> not working any more
Posted: 4 May 26, 21:55   in response to: JeffTucker in response to: JeffTucker
 
  Click to reply to this thread Reply
BTW, while fiddling with this, I stumbled on something that I suspected - this exercise confirmed it. Bug report:

https://jalbum.net/forum/thread.jspa?threadID=61101
JeffTucker

Posts: 8,330
Registered: 31-Jan-2006
Re: <ja:if exists="gpsLocation"> not working any more
Posted: 5 May 26, 14:29   in response to: JeffTucker in response to: JeffTucker
 
  Click to reply to this thread Reply
To get around this bug, if you have trimmed videos within jAlbum, the "video" line of your template would need to be something like this:
<ja:if test="${fileCategory}" value="video"><ja:if not exists="originalDate"><i>${fileDate}</i></ja:if> | <i>FPS: ${videoFPS} - Auflösung: ${videoWidth}x${videoHeight} - Dauer: <ja:if exists="videoClipLength"><%=videoClipLength.toString().split('.')[0]%></ja:if><ja:else><%=videoDuration.toString().split('.')[0]%></ja:else></i></ja:if>
It ain't pretty, but tested, and it works.
MarkusD

Posts: 866
Registered: 13-Apr-2006
Re: <ja:if exists="gpsLocation"> not working any more
Posted: 5 May 26, 21:14   in response to: JeffTucker in response to: JeffTucker
 
  Click to reply to this thread Reply
Jeff, thanks again for this correction.
JeffTucker

Posts: 8,330
Registered: 31-Jan-2006
Re: <ja:if exists="gpsLocation"> not working any more
Posted: 5 May 26, 21:52   in response to: MarkusD in response to: MarkusD
 
  Click to reply to this thread Reply
Just the last gasp before I’m replaced completely by an AI bot.
MarkusD

Posts: 866
Registered: 13-Apr-2006
Re: <ja:if exists="gpsLocation"> not working any more
Posted: 7 May 26, 15:15   in response to: JeffTucker in response to: JeffTucker
 
  Click to reply to this thread Reply
JeffTucker wrote:
Just the last gasp before I’m replaced completely by an AI bot.
That will never happen. No AI can compete with your knowledge!

To be honest, new problems are around the corner. :-/

I'll get back with that later.
JeffTucker

Posts: 8,330
Registered: 31-Jan-2006
Re: <ja:if exists="gpsLocation"> not working any more
Posted: 7 May 26, 15:34   in response to: MarkusD in response to: MarkusD
 
  Click to reply to this thread Reply
Recently, for the first time, I fed a minor coding issue to AI, and was astonished that it didn't just modify what I gave it to achieve the desired objective. No, it actually completely rewrote what I fed it, in a much more concise, maintainable form.

My prediction is that within a year, skin development will become a lost art. Users will be able to take the existing skins and just ask AI to add features, change things, etc. AI may not be able to come up with truly new, creative ideas, but my ability to do that slowly faded away years ago.
MarkusD

Posts: 866
Registered: 13-Apr-2006
Re: <ja:if exists="gpsLocation"> not working any more
Posted: 7 May 26, 15:38   in response to: MarkusD in response to: MarkusD
 
  Click to reply to this thread Reply
Attachment code-caption.txt (2.4 KB)
So, after updating to JA 39.5 and Tiger 8.0.4. the whole code for the location does not work anymore.

Sample with JA 39.5 and Tiger 8.0.4
https://www.markus-drueck.de/public/2026%2001%2030%20Norge/2026%2001%2030%20Norge/2026%2002%2002%20%C3%96stersund%20-%20Jokkmokk/index.html#img=IMG_1693.avif

Sample with JA 39.4.1 and Tiger 8.0.4
https://www.markus-drueck.de/norge/2026%2001%2030%20Norge/2026%2002%2002%20%C3%96stersund%20-%20Jokkmokk/index.html#img=IMG_1693.avif

The code for the caption attached.
JeffTucker

Posts: 8,330
Registered: 31-Jan-2006
Re: <ja:if exists="gpsLocation"> not working any more
Posted: 7 May 26, 15:52   in response to: MarkusD in response to: MarkusD
 
  Click to reply to this thread Reply
The test album I built for this is still working exactly the same way with jAlbum 39.5 and Tiger 8.0.4. Made again, uploaded:

https://jefftucker.jalbum.net/MDtest/

The caption code:
<ja:if exists="originalDate"><i>${originalDate}</i></ja:if>
<ja:if test="${fileCategory}" value="video"><ja:if not exists="originalDate"><i>${fileDate}</i></ja:if> | <i>FPS: ${videoFPS} - Auflösung: ${videoWidth}x${videoHeight} - Dauer: <ja:if exists="videoClipLength"><%=videoClipLength.toString().split('.')[0]%></ja:if><ja:else><%=videoDuration.toString().split('.')[0]%></ja:else></i></ja:if>
<ja:if exists="gpsLocation">
 | <a href="https://maps.google.com/?q=${gpsLocation}" class="mylink" rel="noreferrer nofollow"><img class="mapmarker" src="res/mapmarker.svg" alt="" title="Google"></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"><img class="mapmarker" src="res/mapmarker.svg" alt="" title="OSM"></a>
 | <a href="https://kart.finn.no/?lng=<%=gpsLocation.split(',')[1]%>&lat=<%=gpsLocation.split(',')[0]%>" class="mylink" rel="noreferrer nofollow"><img class="mapmarker" src="res/mapmarker.svg" alt="" title="kart.finn.no"></a>
 | <a href="https://www.windy.com/?${gpsLocation},16" class="mylink" rel="noreferrer nofollow"><img class="mapmarker" src="res/mapmarker.svg" alt="" title="windy.com"></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;">&starf;</span></ja:case>
<ja:case value="2"> | <span style="color:gold;">&starf;&starf;</span></ja:case>
<ja:case value="3"> | <span style="color:gold;">&starf;&starf;&starf;</span></ja:case>
<ja:case value="4"> | <span style="color:gold;">&starf;&starf;&starf;&starf;</span></ja:case>
<ja:case value="5"> | <span style="color:gold;">&starf;&starf;&starf;&starf;&starf;</span></ja:case>
<ja:default></ja:default>
</ja:switch>
<ja:if exists="fileTitle"> | ${fileTitle}</ja:if> | ${comment}
ETA: Also works if I use Laza's "icon-location" instead of my own SVG.
MarkusD

Posts: 866
Registered: 13-Apr-2006
Re: <ja:if exists="gpsLocation"> not working any more
Posted: 8 May 26, 07:37   in response to: RobM in response to: RobM
 
  Click to reply to this thread Reply
RobM wrote:
MarkusD wrote:
Laza wrote:
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?
Rob, why haven't it thought more about your advice? Because that is the solution to my problem. Yes, I wasn't using this option ever. But something obviously has changed recently in JA. Now I have to check this option to make the GPS-Info available for the captions.

This is nevertheless very confusing. Yes, there are GPS infos in the xmp-section of my pictures, but they are also in the Gps-section
Gps.GPS Altitude=1 metres
Gps.GPS Altitude Ref=Sea level
Gps.GPS Date Stamp=2026:01:31
Gps.GPS Latitude=56° 1' 58,19"
Gps.GPS Latitude Ref=N
Gps.GPS Longitude=12° 37' 6,48"
Gps.GPS Longitude Ref=E
Gps.GPS Map Datum=WGS-84
Gps.GPS Time-Stamp=07:03:28,000 UTC
Gps.GPS Version ID=2.200
 
xmp.exif:GPSAltitude=1/1
xmp.exif:GPSAltitudeRef=0
xmp.exif:GPSLatitude=56,1.969830N
xmp.exif:GPSLongitude=12,37.108050E
xmp.exif:GPSMapDatum=WGS-84
xmp.exif:GPSTimeStamp=2026-01-31T07:03:28Z
xmp.exif:GPSVersionID=2.2.0.0


So, it seems to me, that now the GPS info are read from the xmp not from the Gps section anymore.

Just to let you know.
Legend
Forum admins
Helpful Answer
Correct Answer

Point your RSS reader here for a feed of the latest messages in all forums