MerginMaps / mobile

Mobile app for Mergin Maps 📲. Open QGIS projects and manage vector data on your phone, even offline 📶 (Android/iOS/Windows app)
https://merginmaps.com
GNU General Public License v2.0
295 stars 65 forks source link

Exif metadata functions not calculating #2490

Open qnmai opened 1 year ago

qnmai commented 1 year ago

Cloned the exif-metadata project onto a Samsung Galaxy Tab A (Android 10), using the Mergin Maps app v 1.6.0.

The fields using the exif formulas do not auto populate as expected.

qnmai commented 1 year ago

Tested with v1.4.0 and v1.9.0 on SM-T575 and the exif formulas set up in the example project all work except date_raw.

qnmai commented 1 year ago

Tested with v1.4.0 on the Samsung Galaxy Tab A, and only lat_raw and long_raw work (not direction_raw, nor date_raw).

qnmai commented 1 year ago

Tested with v1.9.0 on the Samsung Galaxy Tab A, and none of the exif formulas auto populate.

PeterPetrik commented 1 year ago

Hi @qnmai , let me move this issue to the Input repository -> this is probably related to the mobile app. Do you use the test project from the tutorial/official docs? Those should be tested by @jozef-budac

qnmai commented 1 year ago

Hi @qnmai , let me move this issue to the Input repository -> this is probably related to the mobile app. Do you use the test project from the tutorial/official docs? Those should be tested by @jozef-budac

Yes, i've tested the projects mentioned in these two links: photo_survey (https://www.lutraconsulting.co.uk/blog/2021/04/20/photo-exif-input/) exif-metdata (https://merginmaps.com/docs/layer/exif_metadata/)

jozef-budac commented 1 year ago

Hi @qnmai I just tested Exif on my test devices on 1.9.0 version of Input and the fields are populated. So I believe it is something outside input. Can you please describe your scenario in more details? It is possible some important step is missing.

The scenario I just tested is: 1) open project https://app.merginmaps.com/projects/lutraconsulting/photo_survey/tree 2) Hit Record button and then hit Add button. The form opens with empty fields. 3) Now hit camera and take a picture. The fields are populated with exif data. -> 3rd step can be done also with a picture from gallery.

Do you use the same steps? If yes, can you confirm, that in your picture from camera there are exif data written ?

qnmai commented 1 year ago

hi @jozef-budac -- i did follow those steps. I also verified that localisation tags is activated on the camera app.

Checked both tablets mentioned using BR's EXIFextractor (via the Samsung photo app, the details on the photos were the same for both tablets, whereas only one tablet succeeds in showing the direction) :

jozef-budac commented 1 year ago

Hi @qnmai I have my personal Samsung Tablet A7 (SM-T220) I did some tests with input 1.9.0 there and here are my observations:

1) when I use default camera with default settings, only directions works. No other fields are populated. 2) when I enables storing of location information into photos, and use photo from input, still only direction was populated 3) when I capture photo outside merginmaps app with default camera app with location information settings turn on, and then I use gallery option in merginmaps app, I saw direction was 0 but longitude and latitude was populated. 4) when I installed different camera app (OpenCamera) and capture a picture outside merginmaps app and then use gallery option in merginmaps app to load the picture, all fields were populated (direction, longitude and latitude)

So my conclusion is, Samsung default camera is not good for storing exif data into pictures and I would suggest you to use different camera app.

jozef-budac commented 1 year ago

I tried to capture few more pictures from default camera and mergin app can read it correctly. It looks like, default camera needs some time to get location data. But still, you said that your pictures contains Exif data.. Can you still try to use OpenCamera to verify, if it works?

qnmai commented 1 year ago

I tried to capture few more pictures from default camera and mergin app can read it correctly. It looks like, default camera needs some time to get location data. But still, you said that your pictures contains Exif data.. Can you still try to use OpenCamera to verify, if it works?

Not all of the pictures contain Exif data:

I've installed the OpenCamera and tried using Mergin, but the default camera still opens. Searching for solution currently, but do let me know if you have a suggestion ; ) Thank you!

Also, what do you mean by 'needs some time'. At what point should I wait in order to give it more time (ex: before adding the point, before taking the picture, ...)

jozef-budac commented 1 year ago

Unfortunately Samsung phones doesn't allow you to choose different camera app as the default camera. It is very strange restriction, which other manufacturers don't have. This means, you would probably need to open OpenCamera outside MerginMaps app and take the picture and than in MerginMaps app opens it using gallery option. I understand this can be annoying

By 'needs some time' I mean, that samsung camera app doesn't have any option to force exif data to be stored into pictures. This means, it stores the picture, even when location data are not available for it. So my suggestion is, when you hit camera option in MerginMaps app and the camera screen opens, I would try to wait for few seconds, so the samsung camera app can get location data and then hit the record button to take the picture.

As the storing of exif data is done by camera app, we can't do much.

saberraz commented 1 year ago

@jozef-budac this is not only Samsung. From Android 11+, you cannot set a 3rd party camera app as your default app: https://issuetracker.google.com/issues/162643544?pli=1#comment6

saberraz commented 1 year ago

@jozef-budac this is not only Samsung. From Android 11+, you cannot set a 3rd party camera app as your default app: https://issuetracker.google.com/issues/162643544?pli=1#comment6

jozef-budac commented 1 year ago

Thank @saberraz . I didn't know that.

qnmai commented 1 year ago

Just going back to your test with the A7 @jozef-budac : this tablette doesn't have the gyroscopic sensor but does indeed show the direction? Asking because it only has a geomagnetic sensor (like the Tab A). After testing with a 30 second wait after opening the camera on the Tab A, still no direction information.