mobile icon indicating copy to clipboard operation
mobile copied to clipboard

Attaching a screenshot results in error with Samsung phones

Open raherin opened this issue 2 months ago • 2 comments

Sometimes when using a Samsung phone, the app returns an error when attaching a screenshot as a photo. This appears to be a specific issue with the way Samsung's flavor of Android handles the naming of screenshots by adding the name of the app in the screenshot as a prefix to the photo. If the name of the app contains any spaces, the photo will fail to save to the app.

To reproduce the issue:

  1. Add a Survey point.
  2. Choose to add a photo from gallery.
  3. Switch to another app to make a screenshot.
  4. Make the screenshot.
  5. Switch back to Mergin Maps app.
  6. Select the screenshot which you just made.
  7. Try to save.

Adding a screenshot of 'Chrome' browser (works): chrome screenshot

Adding a screenshot of 'Play Store' (fails): play store screenshot

In the diagnostic log, I see this when the photo attachment fails:

2025-10-15T16:28:32.033Z AppState: "Application changed state to:" Qt::ApplicationInactive
2025-10-15T16:28:32.895Z AppState: "Application changed state to:" Qt::ApplicationSuspended
2025-10-15T16:28:35.230Z Select image: Failed to copy image file to /storage/emulated/0/Android/data/uk.co.lutraconsulting/files/projects/1_photos/Screenshot_20251015_172650_Google%20Play%20Store.jpg
2025-10-15T16:28:35.280Z AppState: "Application changed state to:" Qt::ApplicationActive
2025-10-15T16:28:35.285Z Image Loading: Could not load the image. It may be missing or invalid, the URL might be incorrect, or there may be no network connection: /storage/emulated/0/Android/data/uk.co.lutraconsulting/files/projects/1_photos//Screenshot_20251015_172650_Google%20Play%20Store.jpg

Device: Samsung A53 Android (15.0) Mergin Maps v2025.5.0

raherin avatar Oct 15 '25 16:10 raherin

You can find the builds to test here: https://github.com/MerginMaps/mobile/pull/4229#issuecomment-3579983601

tomasMizera avatar Nov 26 '25 08:11 tomasMizera

Test reproduced on device: Samsung A53/Android (15.0) Mergin Maps Build: 733911

Steps to reproduce:

  1. Add a new feature (Survey layer).
  2. Choose to add a photo from gallery.
  3. Switch to another app (Play store) to make a screenshot.
  4. Make the screenshot from Play store.
  5. Switch back to Mergin Maps app.
  6. Select the screenshot which you made.
  7. Save the feature.

Actual Result: After taking a screenshot of the application (Play store) and attempting to add it from the gallery, the process fails. The application displays an error message: "Failed to process the image"

Comment: Despite the fact, that adding the screenshot of the application (Play store) from the gallery failed, this screenshot is uploaded into the QGIS.

Please, see video below:

https://github.com/user-attachments/assets/bb1f5446-66ed-40a1-b759-64b702bb7954

IvaKuklica avatar Nov 26 '25 11:11 IvaKuklica