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


Permlink Replies: 14 - Pages: 1 - Last Post: 5 Nov 24, 20:54 Last Post By: RobM Threads: [ Previous | Next ]
MarkusD

Posts: 633
Registered: 13-Apr-2006
"Add same location to all.bsh" -> fails with videos
Posted: 26 Oct 22, 18:26
 
  Click to reply to this thread Reply
Hi,

the tool Add same location to all.bsh fails, if there is a video in the folder to be processed.
java.lang.NullPointerException: Null Pointer in Method Invocation of getGpsLocation() on variable: xm in Add same location to all.bsh at line number 93

I assume that this is wrong:

} else if (cat == Category.image || cat == Category.video || cat == Category.audio  || cat == Category.other) {


If I understand that code right, then the following code is executed if the file is an image or a video or an audio file or another file. As far as I know only picture files are able to "store" location data.

Anyway, can someone please look into this and fix it? Thanks in advance.

Edited by: RobM on 26 Oct 2022, 18:18
Added link to Laza’s tool post
RobM

Posts: 3,828
Registered: 4-Aug-2006
Re: "Add same location to all.bsh" -> fails with videos
Posted: 26 Oct 22, 19:22   in response to: MarkusD in response to: MarkusD
 
  Click to reply to this thread Reply
Laza will probably fix it. Videos can store location data, though it might need extracting to user variables.
MarkusD

Posts: 633
Registered: 13-Apr-2006
Re: "Add same location to all.bsh" -> fails with videos
Posted: 7 Apr 23, 18:01   in response to: RobM in response to: RobM
 
  Click to reply to this thread Reply
Laza, can you have please have a look into this issue? Thanks a lot.
MarkusD

Posts: 633
Registered: 13-Apr-2006
Re: "Add same location to all.bsh" -> fails with videos
Posted: 4 Nov 24, 19:22   in response to: MarkusD in response to: MarkusD
 
  Click to reply to this thread Reply
Two years later, still facing the same problem. :-) Anybody out there who can fix this, please? Thanks a lot. Markus
RobM

Posts: 3,828
Registered: 4-Aug-2006
Re: "Add same location to all.bsh" -> fails with videos
Posted: 4 Nov 24, 19:29   in response to: MarkusD in response to: MarkusD
 
  Click to reply to this thread Reply
I’ll move this thread to the skin and tools development thread, Laza might see it there but I think a pm might be better to get his attention.
MarkusD

Posts: 633
Registered: 13-Apr-2006
Re: "Add same location to all.bsh" -> fails with videos
Posted: 4 Nov 24, 19:40   in response to: RobM in response to: RobM
 
  Click to reply to this thread Reply
Thanks Rob!
RobM

Posts: 3,828
Registered: 4-Aug-2006
Re: "Add same location to all.bsh" -> fails with videos
Posted: 4 Nov 24, 21:01   in response to: MarkusD in response to: MarkusD
 
  Click to reply to this thread Reply
When you run the tool it does say add to all images, so I don't see why you can't just delete those or statements for other categories. After all, you're only updating your copy of the tool.
Laza

Posts: 1,832
Registered: 6-Sep-2005
Re: "Add same location to all.bsh" -> fails with videos
Posted: 5 Nov 24, 12:50   in response to: MarkusD in response to: MarkusD
 
  Click to reply to this thread Reply
Sorry, I haven't noticed this thread so far.

You can also apply the location to the selected images. This way you can avoid such problems.

I believe videos can also have metadata, cannot they?

I have attached the fixed tool. I removed Audio and Other types from this version, but the code checks if the metadata exists before it tries to access the location.
RobM

Posts: 3,828
Registered: 4-Aug-2006
Re: "Add same location to all.bsh" -> fails with videos
Posted: 5 Nov 24, 14:00   in response to: Laza in response to: Laza
 
  Click to reply to this thread Reply
Laza wrote:
I believe videos can also have metadata, cannot they?
I made a tool to add gps location data, basically populating jAlbum’s gps location fields as in the location window in edit mode. It uses ffmpeg to look for gps data already in the video. Apple places gps for videos under a QuickTime directory, jAlbum can’t see this but ffmpeg and exiftool can.

My tool https://jalbum.net/forum/thread.jspa?threadID=54566&tstart=0

There is a tool that uses ExifTool, https://jalbum.net/forum/thread.jspa?threadID=55916&tstart=25
MarkusD

Posts: 633
Registered: 13-Apr-2006
Re: "Add same location to all.bsh" -> fails with videos
Posted: 5 Nov 24, 17:17   in response to: Laza in response to: Laza
 
  Click to reply to this thread Reply
Thanks Laza,

but now its worse, I even get an error if only pictures (to be honest, these are only screenshots, PNG files) are involved.

bsh.UtilEvalError: Attempt to resolve method: length() on undefined variable or class name: creator in Add same location to all.bsh at line number 152

I created a zip file with some files for testing.
https://www.markus-drueck.de/JA/10.7z

The coordinates:
60.601887,7.503842

Thanks, Markus
RobM

Posts: 3,828
Registered: 4-Aug-2006
Re: "Add same location to all.bsh" -> fails with videos
Posted: 5 Nov 24, 17:59   in response to: MarkusD in response to: MarkusD
 
  Click to reply to this thread Reply
Unless something has changed, and I’ve got the metadata right, location data written to the edit window>Location pane only works for jpeg images.
MarkusD

Posts: 633
Registered: 13-Apr-2006
Re: "Add same location to all.bsh" -> fails with videos
Posted: 5 Nov 24, 18:51   in response to: RobM in response to: RobM
 
  Click to reply to this thread Reply
Rob, Laza,

thanks for your help and ideas so far.

Please try to think from a users point of view, not from a developers point of view.

A user has some objects, pictures (jpg, png, svg, gif, webp etc.), PDFs, videos.

Now this user wants do give all these objects location data. Don't ask if this makes sense from your point of view. It makes sense from the users point of view. :-)

And now things get bad, really bad, because if you enter the location data in the "Postion" pane on the right side for a video it seems that JA accepts the location data. But it does not. Which is super frustrating, because there is no feedback from the GUI that this is not possible.

This is one of many big fails in the GUI of JA which make me sick for years now. And I'm surprised that David doesn't fix this.

And no, I don't want to use some extra tools to get location data in files other than jpg. The JA GUI should handle that for me. If your answer is, many files don't allow to store meta data like location data, don't tell me that, I don't care how you solve that problem, but solve it. Just a thought, why don't JA store location data in "info" files of the objects?

<?xml version="1.0" encoding="UTF-8"?>
<java version="22" class="java.beans.XMLDecoder">
 <object class="java.util.HashMap">
  <void method="put">
   <string>keywords</string>
   <string>Bahnhof, Baustelle, Finse, WebCam</string>
  </void>
  <void method="put">
   <string>userVariables</string>
   <object class="java.util.LinkedHashMap">
    <void method="put">
     <string>xWeight</string>
     <string>0.5</string>
    </void>
    <void method="put">
     <string>yWeight</string>
     <string>0.4947</string>
    </void>
   </object>
  </void>
  <void method="put">
   <string>title</string>
   <string>Finse</string>
  </void>
 </object>
</java>

I don't see any problem to add a section to store the location data here?

And by the way there is already some kind of trick to add location data for files other than jpg. Using the user variable "gpsLocation", but this is an awful „solution“.

So, please, make adding location data to every file type work. I'm sure that this a no-brainer for team Sweden. :-)

Cheers, Markus
RobM

Posts: 3,828
Registered: 4-Aug-2006
Re: "Add same location to all.bsh" -> fails with videos
Posted: 5 Nov 24, 20:32   in response to: MarkusD in response to: MarkusD
Helpful
  Click to reply to this thread Reply
MarkusD wrote:
Thanks Laza,

but now its worse, I even get an error if only pictures (to be honest, these are only screenshots, PNG files) are involved.

bsh.UtilEvalError: Attempt to resolve method: length() on undefined variable or class name: creator in Add same location to all.bsh at line number 152

I created a zip file with some files for testing.
https://www.markus-drueck.de/JA/10.7z

The coordinates:
60.601887,7.503842

Thanks, Markus

As far as I can see lines 152, 153 and 154 can be removed, those variables (useCreator, useCopyright and useCopyrightUrl) are not referenced anywhere else in the script. I just rem'd them out and the tool works.
MarkusD

Posts: 633
Registered: 13-Apr-2006
Re: "Add same location to all.bsh" -> fails with videos
Posted: 5 Nov 24, 20:38   in response to: RobM in response to: RobM
 
  Click to reply to this thread Reply
Thanks Rob! Yes, now the tool works. Videos are not a problem any more, they don't through any errors. Cheers, Markus
RobM

Posts: 3,828
Registered: 4-Aug-2006
Re: "Add same location to all.bsh" -> fails with videos
Posted: 5 Nov 24, 20:54   in response to: MarkusD in response to: MarkusD
 
  Click to reply to this thread Reply
Sorry you're not happy. My last post was based on the user manual, first 'note' at the top of the page https://jalbum.net/help/en/Geotagging. Apparently this has changed, as far as I can tell from version 23. I'll update that note to show videos that are not mp4, PDFs, Word documents etc. are not supported.

If That changes I'll try to notice the change.
Legend
Forum admins
Helpful Answer
Correct Answer

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