Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move imageanalytics' image_loader to Orange #6889

Open
janezd opened this issue Sep 11, 2024 · 2 comments
Open

Move imageanalytics' image_loader to Orange #6889

janezd opened this issue Sep 11, 2024 · 2 comments

Comments

@janezd
Copy link
Contributor

janezd commented Sep 11, 2024

Add-on orange3-pumice now usesorangecontrib.imageanalytics.widgets.owimageviewer.image_loader and ImageLoader for loading images (biolab/orange3-pumice#6). What about moving them and related functions to core Orange?

They may be useful in other add-ons, too. E.g., the Geo add-on includes an ImageLoader with a comment

# Mostly a copy from OWImageViewer in imageanalytics add-on
@janezd janezd added the needs discussion Core developers need to discuss the issue label Sep 11, 2024
@janezd
Copy link
Contributor Author

janezd commented Sep 12, 2024

If we do so, here's a bug to fix.

        qnam = ImageLoader.networkAccessManagerInstance()
        future, deferred = image_loader(QUrl(url), qnam)
        f = deferred()
        w = FutureWatcher(f, )
        w.done.connect(self.__on_future_done)

The signal is never triggered. One has to either set a parent, qnam.setParent(self), (bad: this instance is shared!) or set up another manager, e.g. QNetworkAccessManager(self).

Apparently, the parentless network access manager dies a premature death. Or I am misusing it.

Perhaps a network access manager should be created for the entire app?

@janezd janezd removed the needs discussion Core developers need to discuss the issue label Sep 20, 2024
@ales-erjavec
Copy link
Contributor

Please no. ImageLoader is bad and should not be used elsewhere or be advertised (i.e. moved to common util package)

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

No branches or pull requests

2 participants