Skip to content

Online image preview support#3711

Merged
tomasMizera merged 15 commits intomasterfrom
enhancement/onlineImages
Mar 21, 2025
Merged

Online image preview support#3711
tomasMizera merged 15 commits intomasterfrom
enhancement/onlineImages

Conversation

@VitorVieiraZ
Copy link
Copy Markdown
Contributor

@VitorVieiraZ VitorVieiraZ commented Feb 19, 2025

When loading a photo, we now also verify if it's a url. If the url is valid, we consider it a valid image and proceed to load it. Since some urls might take longer to load, which is beyond our control, a MMBusyIndicator has been added to MMPhoto to enhance user experience in cases where loading images from urls might take a while.

Screen.Recording.2025-02-19.at.18.36.12.mov
Remote image loading with error

Resolves #2718

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Feb 19, 2025

Pull Request Test Coverage Report for Build 13921058469

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 64 unchanged lines in 3 files lost coverage.
  • Overall coverage increased (+0.1%) to 60.352%

Files with Coverage Reduction New Missed Lines %
input/app/inpututils.cpp 6 52.54%
input/core/merginapi.cpp 8 79.68%
input/app/mmstyle.h 50 1.94%
Totals Coverage Status
Change from base Build 13587741405: 0.1%
Covered Lines: 8025
Relevant Lines: 13297

💛 - Coveralls

Comment thread app/qml/form/editors/MMFormPhotoEditor.qml Outdated
Comment thread app/inpututils.cpp Outdated
Comment thread app/inpututils.cpp Outdated
Comment thread app/qml/form/editors/MMFormPhotoEditor.qml Outdated
Comment thread app/test/testutils.cpp Outdated
@VitorVieiraZ VitorVieiraZ changed the title WIP - Online Image Preview Support WIP - Online image preview support Feb 24, 2025
@VitorVieiraZ VitorVieiraZ changed the title WIP - Online image preview support Online image preview support Feb 27, 2025
Comment thread app/qml/components/MMPhoto.qml Outdated
@PeterPetrik
Copy link
Copy Markdown
Contributor

please rebase with master (cppcheck fix)

@VitorVieiraZ VitorVieiraZ force-pushed the enhancement/onlineImages branch from f88d9c7 to 5a885ee Compare February 28, 2025 12:43
@tomasMizera
Copy link
Copy Markdown
Collaborator

In case of error, can we use the error text message to say that we could not load the image?

Comment thread app/qml/components/MMPhoto.qml Outdated
Comment thread app/qml/components/MMPhoto.qml Outdated
Comment thread app/inpututils.h Outdated
Copy link
Copy Markdown
Collaborator

@tomasMizera tomasMizera left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just this one change please 😇

Comment thread app/qml/form/editors/MMFormPhotoViewer.qml Outdated
@VitorVieiraZ
Copy link
Copy Markdown
Contributor Author

Suggested project for testing: https://app.merginmaps.com/projects/support/save_images_to_web.

harminius

This comment was marked as resolved.

Copy link
Copy Markdown

@harminius harminius left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested on Android 📗
Tested for

Screencast.from.20-03-25.08.19.37.webm

@tomasMizera
Copy link
Copy Markdown
Collaborator

* Google drive 🔴 (https://drive.google.com/file/d/1Xenct9UGIubJNgawErWaUCfln7edqrc8/view?usp=drive_link)
  * app gives `Could not load the image error`

Thanks @harminius! For Google drive, I suspect it is because GDrive does a redirect when visiting the image. Could you try it with the final link please (https://drive.google.com/file/d/1Xenct9UGIubJNgawErWaUCfln7edqrc8/view)?

Screencast.from.20-03-25.08.19.37.webm

That's sick 🙃 I guess QGIS is using webview then

@tomasMizera tomasMizera requested a review from harminius March 21, 2025 08:52
Copy link
Copy Markdown

@harminius harminius left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried the final link, too. Not sure what QGIS showed but the mobile app didn't loaded the image.

EDIT: It does the same. Webview for QGIS and fail for the app.

@tomasMizera
Copy link
Copy Markdown
Collaborator

I tried the final link, too. Not sure what QGIS showed but the mobile app didn't loaded the image.

EDIT: It does the same. Webview for QGIS and fail for the app.

Ok, I checked and it seems like downloading a public file from GDrive is actually not that easy :) (see https://stackoverflow.com/a/30783921/7875594). Let's merge this one then!

@tomasMizera tomasMizera merged commit 1c044bf into master Mar 21, 2025
12 checks passed
@tomasMizera tomasMizera deleted the enhancement/onlineImages branch March 21, 2025 18:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow preview of online images in feature forms

6 participants