mobile icon indicating copy to clipboard operation
mobile copied to clipboard

Photo sketching support

Open Withalion opened this issue 7 months ago • 3 comments

This PR adds photo sketching support to the mobile app!

Closes MerginMaps/product#55 Connected to plugin PR

The sketching is available while editing a feature with photo already attached: image

A new page will open with the photo. 7 colors are available for sketching. If you make any mistakes, there is undo and also close button for throwing away all changes. If the sketches look good "save changes" button will save them to the original image. image

Demo:

https://github.com/user-attachments/assets/3cca843c-5d80-43ef-b252-16b1b0dafdd7

Photo sketching can be disabled in project in QGIS plugin.

Withalion avatar Jun 13 '25 15:06 Withalion

Tests are failing on map annotations test, fix introduced by #3929

EDIT: should be fixed now by rebase

Withalion avatar Jun 13 '25 17:06 Withalion

Updated UI (more similar to map sketches):

image

Withalion avatar Jun 16 '25 19:06 Withalion

Pull Request Test Coverage Report for Build 16902051591

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 177 unchanged lines in 6 files lost coverage.
  • Overall coverage decreased (-0.6%) to 58.935%

Files with Coverage Reduction New Missed Lines %
input/app/position/providers/simulatedpositionprovider.cpp 1 90.91%
input/core/merginapi.cpp 3 75.09%
input/app/activeproject.cpp 4 69.83%
input/app/inputhelp.cpp 39 34.75%
input/app/mmstyle.h 50 1.92%
input/app/main.cpp 80 33.06%
<!-- Total: 177
Totals Coverage Status
Change from base Build 16828823279: -0.6%
Covered Lines: 8304
Relevant Lines: 14090

💛 - Coveralls

github-actions[bot] avatar Jun 16 '25 20:06 github-actions[bot]

Linux - failed on MerginApi tests iOS - failed on testflight version

Withalion avatar Jul 16 '25 12:07 Withalion

To answer some questions from @RastoHu (in the linked issue):

  1. There was no intention of having an eraser, users can undo their last sketch or discard all sketches
  2. That is not something we can influence much. The landscape mode is probably more usable for tablets. There was also some intention to have zooming and panning of photo, but that is not getting implemented yet.
  3. -5. This is a new bug which was not happening to me before have to investigate further... new pictures turn 90 degrees left on save

Withalion avatar Jul 18 '25 10:07 Withalion

The failing link test seems to give quite random output. Somehow the http requests are getting QNetworkReply::UnknownServerError, but it's usually just random one. The links can be opened from Android without issues.

Withalion avatar Jul 22 '25 19:07 Withalion

@Withalion @tomasMizera Devices: Android 14 - merginmaps-682511.apk iOS 18.5 - 25.7.778511 Android 14 (tablet) - merginmaps-682511.apk iPad iOS 18.5 - 25.7.778511

Issues:

  1. Sketch is not saved for new records: add new record in mobile app -> take picture -> DO NOT save the record -> add sketches to this photo -> on map sketches screen click Done -> No sketches visible on picture -> Save record -> if this new record is reopened, sketches are missing on photo

https://github.com/user-attachments/assets/8e709db5-4263-49cb-a5b4-67c137528a0c

  1. Photo taken in landscape mode is not fully visible on mobile device - once the photo was taken in landscape camera position and record was saved, after reopening the record, the photo is slightly moved to the right and right part of picture is not visible on device in portrait orientation.

https://github.com/user-attachments/assets/4e8ca358-3e3a-4e8a-9ea0-94d5fa375c64

  1. Strange issue on Android tablet and iPad: To make an undo action, user must tap Undo button two times to remove the photo sketches from photo. This is reproducible if the sketch was drawn by pen only, drawing with finger is ok.

https://github.com/user-attachments/assets/376da013-406a-40e1-bd02-fb7849a5c374

RastoHu avatar Jul 30 '25 15:07 RastoHu

@RastoHu

  1. I tried to replicate this but with no success, let's talk about it tomorrow
  2. This is a valid bug, please log it, but it's not blocking this PR and needs to be fixed as a part of Photos refactoring
  3. Could you make a video out of it? It might be connected to using stylus, but I'll need to debug further

Withalion avatar Jul 31 '25 20:07 Withalion

Landscape mode issue: https://github.com/MerginMaps/mobile/issues/4012

RastoHu avatar Aug 01 '25 09:08 RastoHu

We can do the updates in separate PRs :)

tomasMizera avatar Aug 22 '25 10:08 tomasMizera

Android (694611), iOS (app build 25.8.790411):

  1. when draw photo sketches with apple pencil, undo button does not work. The drawing will be removed only when a new drawing is added to the photo. By watching this video, better experience is with sound :)

https://github.com/user-attachments/assets/9ae6ef8f-bc36-4e8c-a71c-20c51a610bff

  1. app always crash when editing existing record with photo and photo sketches. App crash after clicking on confirm button on photo sketches screen. Reproducible on Android and iSO. (sound on)

https://github.com/user-attachments/assets/a66b6622-8db9-41ee-8855-0810d3e715b8

  1. Sometimes when adding a photo sketches with apple pencil, the sketches are connected with straight lines. (sound off)

https://github.com/user-attachments/assets/2b2a0f3d-6105-4031-9434-e7adc95c41a8

RastoHu avatar Aug 25 '25 10:08 RastoHu

log: rastislav.hudak020625_input-ios-2025.6.0_2025-08-25T11:17:26.035623.log

RastoHu avatar Aug 25 '25 11:08 RastoHu

If I have a record where more then one photo can be added, the photo sketches are available only for the last edited photo:

  1. open project tester-ws-1/test_photo_naming
  2. record new point and take photos for all photo fields
  3. add photo sketches to first 3 photos and to last photo - the photo orientation temporarily changes
  4. save
  5. reopen record -> only the last picture has photo sketches available. The photo orientation for last picture changed

RastoHu avatar Aug 25 '25 13:08 RastoHu

@Withalion @tomasMizera iOS (25.9.796011), Android (2025.6.0-rc2):

  1. Photos with photo sketches disappear when scrolling in the form on a mobile device. After saving the record, the images with sketches are visible again. You can use project tester-ws-1/test_photo-sketches

https://github.com/user-attachments/assets/544a57c1-0f2b-48f5-be85-c2e717de3b7c

  1. Android only: the orientation of photo change after adding photo sketches. And if you save the record and reopen it in edit mode, the orientation change again after adding new sketches - the photo with sketches rotate 90degrees clockwise. You can use project tester-ws-1/test_photo-sketches

RastoHu avatar Sep 03 '25 10:09 RastoHu

@Withalion @tomasMizera iOS (25.9.799711), Android (build 704011):

  1. if you change the geometry while adding new record, the photo sketches temporary disappear from photo and photos are stored with default names instead of custom names.

https://github.com/user-attachments/assets/f67536f7-29ae-4928-b47f-471bc23fd433

  1. Android only: the orientation of photo change after adding photo sketches. And if you save the record and reopen it in edit mode, the orientation change again after adding new sketches - the photo with sketches rotate 90degrees clockwise. You can use project tester-ws-1/test_photo-sketches.

https://github.com/user-attachments/assets/b334b944-45dd-4b3f-b74c-6c3c95990064

RastoHu avatar Sep 04 '25 09:09 RastoHu

@RastoHu

  1. should be fixed by #4100
  2. I'm still unable to reproduce this issue on my device (Fairphone 5, Android 15)

Withalion avatar Sep 11 '25 10:09 Withalion

@RastoHu

  1. should be fixed by Fix missing photosketches after editing geometry #4100
  2. I'm still unable to reproduce this issue on my device (Fairphone 5, Android 15)

@Withalion

  1. disappearing the sketches after editing the geometry is fixed, but the photos are still saved with default names, not custom
  2. I'm still able to reproduce the issue on Samsung device

RastoHu avatar Sep 15 '25 08:09 RastoHu

@Withalion @tomasMizera Android (709611) Re-testing of photos'orientation after adding sketches:

  1. The first record kept it's orientation after sketches - test passed
  2. The orientation of second photo change after sketches. If you save the record and reopen it in edit mode, the orientation change again after adding new sketches - the photo with sketches rotate 90degrees clockwise.
  3. When the geometry of record is changed during adding new point, the photo sketches remain on picture, but saving the record the photos are saved with default names - test failed.

IvaKuklica avatar Sep 17 '25 13:09 IvaKuklica

@IvaKuklica is the 3rd point related to #4020? Were you trying it on the same project or a different one?

Withalion avatar Sep 17 '25 13:09 Withalion

@IvaKuklica @RastoHu some more info:

  1. the renaming bug is not connected to sketching, please file a new issue so we can track it and fix it separately
  2. I'll need more time investigating the Samsung issue as it looks more mysterious than expected

Withalion avatar Sep 17 '25 18:09 Withalion

@IvaKuklica @RastoHu some more info:

  1. the renaming bug is not connected to sketching, please file a new issue so we can track it and fix it separately
  2. I'll need more time investigating the Samsung issue as it looks more mysterious than expected
  1. is not related to the photo sketches, @IvaKuklica please create a new issue for it. thx

RastoHu avatar Sep 22 '25 09:09 RastoHu