Bug 475976 - Path of files for KPA->openwith->Gimp
Summary: Path of files for KPA->openwith->Gimp
Status: REPORTED
Alias: None
Product: kphotoalbum
Classification: Applications
Component: general (show other bugs)
Version: 5.11.0
Platform: Manjaro Linux
: NOR minor
Target Milestone: ---
Assignee: KPhotoAlbum Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-10-22 17:46 UTC by Alex6
Modified: 2023-10-29 20:23 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
attachment-123439-0.html (3.69 KB, text/html)
2023-10-23 06:57 UTC, Alex6
Details
attachment-321435-0.html (6.97 KB, text/html)
2023-10-25 06:53 UTC, Alex6
Details
attachment-522009-0.html (3.72 KB, text/html)
2023-10-27 09:29 UTC, Alex6
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alex6 2023-10-22 17:46:27 UTC
SUMMARY

with KPA, "open with->Gimp" on a thumbnail opens "/run/user/1000/kio-fuse-Xxxxxx/file/the-path-of-the-file-I-wont-to-open"
No problem, but
- Gimp loses my file in its "recent files"
- My images become looong to save & open 


STEPS TO REPRODUCE
No extra step, see above


EXPECTED RESULT
same as with "openwith->Gimp" in dolphin or gwenview for example


SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: 5.27 (the problem has existed for several versions)
(available in About System)
KDE Plasma Version: 
KDE Frameworks Version: 
Qt Version: 

ADDITIONAL INFORMATION
Comment 1 Andreas Schleth 2023-10-22 20:32:32 UTC
Hi Alex,
I just tried with my setup (images on mounted nfs share) and do not have this problem.
You might want to describe your setup a bit more, so one can try to replicate the problem. 
It seems, your images reside on another device mounted via the kio-fuse mechanism.
This could cause these complications.
Have you seen the same issue with a KPA database on a local drive (e.g. the demo database)?
Cheers, Andreas
Comment 2 Alex6 2023-10-23 06:57:03 UTC
Created attachment 162512 [details]
attachment-123439-0.html

Thanks for reply! (and quick reply!)

My images reside effectively on a separate disk, mounted on /home/myhome/images via fstab.
Same issue with KPA demo database on /tmp.

Best regards
Alex

Le dimanche 22 octobre 2023 22:32:32 CEST, vous avez écrit :
> https://bugs.kde.org/show_bug.cgi?id=475976
> 
> Andreas Schleth <schleth_es@web.de> changed:
> 
>            What    |Removed                     |Added
> ----------------------------------------------------------------------------
>                  CC|                            |schleth_es@web.de
> 
> --- Comment #1 from Andreas Schleth <schleth_es@web.de> ---
> Hi Alex,
> I just tried with my setup (images on mounted nfs share) and do not have this
> problem.
> You might want to describe your setup a bit more, so one can try to replicate
> the problem. 
> It seems, your images reside on another device mounted via the kio-fuse
> mechanism.
> This could cause these complications.
> Have you seen the same issue with a KPA database on a local drive (e.g. the
> demo database)?
> Cheers, Andreas
> 
>
Comment 3 Andreas Schleth 2023-10-24 15:16:26 UTC
Hi Alex,

I thought about your issue again and think that it might really be an "interface problem".  The "other one is always the culprit" and "always check the cabling first". So, this can be a pain to pin down. (Is it KPA, Gimp or something in between?)

And, darn!, I can now see part of your problem myself:

My test image is really residing at:
/home/as/eigene_Bilder/2022/12_Bokeh_Test/P3210087.jpg

and open with Gimp shows it as:
/run/user/1000/kio-fuse-lohwgJ/file/home/as/eigene_Bilder/2022/12_Bokeh_Test/P3210087.jpg
This must be a new(ish) feature, because I never realized the translated path before. 
As far as I understand, kio-fuse creates an overlay file system ... (??) ... and some googling shows me that kio-fuse seems to have quite a few problems of it's own. So I will try to uninstall kio-fuse and have a look what happens then ...

Test the other options. open with ... 
okular: /home ...
gwenview: /home ...
chromium: /run/user/...
darktable: /run/user/...
Is this behaviour the same on your system?

Open with ... in dolphin or konqueror always shows the original path "/home/..." for all programs.
[@Johannes: shouldn't the "open with..." dialog work the same as in dolpin (?).]

So one question is, "Why do some programs use the ../kio-fuse/.. path and others the real path?"

This does not answer your question about the misbehaviour in Gimp but might be a first step.

Also it would probably be helpful to know more about your system (which distro? is Gimp installed normally or as a snap/flatpack? what release of KPA are you talking about?)

to be continued ... Andreas
Comment 4 Tobias Leupold 2023-10-24 17:08:17 UTC
Maybe, this is a downstream problem … I can't reproduce this on my Gentoo machine, neither for local files, nor for ones located on NFS …
Comment 5 Andreas Schleth 2023-10-24 17:56:55 UTC
Hi Alex,

I uninstalled kio-fuse on my machine, rebooted and - bingo - the strange path translation is gone!

As far as I understand, kio-fuse is there to improve access to SMB shares and such. I did not dig deeper. For my setup it seems to be quite unnecessary.

Maybe your problems will go away when you uninstall kio-fuse. You can always re-install it if this breaks something essential on your system.

@Tobias: Try it with kio-fuse installed. That may not be present on your machine. On mine it seems to have come with Leap 15.5.

Cheers, Andreas
Comment 6 Johannes Zarl-Zierl 2023-10-24 22:23:09 UTC
I can only talk about the KPhotoAlbum side of things, but KPA creates a list of file URLs from the absolute file name(s) and hands this over to the KIO::ApplicationLauncherJob. I don't see how gwenview or dolphin would do something different here, but looking at the source of KIO::ApplicationLauncherJob I also don't see how the URL is changed by it.

My best guess is that somehow, xdg-desktop-portal-kde is involved because Gimp is a GTK application and there, the URL goes through kioUrlFromSandboxPath(), which calls into KIO::Fuse to convert the URL: https://lxr.kde.org/source/plasma/xdg-desktop-portal-kde/src/filechooser.cpp#0457

As to why the same file is handled differently in Gwenview and dolphin, I'm at a loss.
Comment 7 Alex6 2023-10-25 06:53:25 UTC
Created attachment 162556 [details]
attachment-321435-0.html

Hi,
I have tried to uninstall kio-fuse...
But ( in Manjaro ) plasma-workspace depends on kio-fuse...
And a DIY uninstall of kio-fuse (which I don't know how to do) would last until the next update.

My Manjaro versions:
KPA 5.11.0
Plasma-workspace 5.27.8
Gimp 2.10.34 (same behavior with 2.99.x)
No flatpak & Co.

Cheers
Alex

Le mardi 24 octobre 2023 17:16:26 CEST, vous avez écrit :
> https://bugs.kde.org/show_bug.cgi?id=475976
> 
> --- Comment #3 from Andreas Schleth <schleth_es@web.de> ---
> Hi Alex,
> 
> I thought about your issue again and think that it might really be an
> "interface problem".  The "other one is always the culprit" and "always check
> the cabling first". So, this can be a pain to pin down. (Is it KPA, Gimp or
> something in between?)
> 
> And, darn!, I can now see part of your problem myself:
> 
> My test image is really residing at:
> /home/as/eigene_Bilder/2022/12_Bokeh_Test/P3210087.jpg
> 
> and open with Gimp shows it as:
> /run/user/1000/kio-fuse-lohwgJ/file/home/as/eigene_Bilder/2022/12_Bokeh_Test/P3210087.jpg
> This must be a new(ish) feature, because I never realized the translated path
> before. 
> As far as I understand, kio-fuse creates an overlay file system ... (??) ...
> and some googling shows me that kio-fuse seems to have quite a few problems of
> it's own. So I will try to uninstall kio-fuse and have a look what happens then
> ...
> 
> Test the other options. open with ... 
> okular: /home ...
> gwenview: /home ...
> chromium: /run/user/...
> darktable: /run/user/...
> Is this behaviour the same on your system?
> 
> Open with ... in dolphin or konqueror always shows the original path
> "/home/..." for all programs.
> [@Johannes: shouldn't the "open with..." dialog work the same as in dolpin
> (?).]
> 
> So one question is, "Why do some programs use the ../kio-fuse/.. path and
> others the real path?"
> 
> This does not answer your question about the misbehaviour in Gimp but might be
> a first step.
> 
> Also it would probably be helpful to know more about your system (which distro?
> is Gimp installed normally or as a snap/flatpack? what release of KPA are you
> talking about?)
> 
> to be continued ... Andreas
> 
>
Comment 8 Alex6 2023-10-27 07:02:26 UTC
After finding a mean to uninstall kio-fuse ( I'm not a pro... )
everything works fine.
Comment 9 Tobias Leupold 2023-10-27 08:09:25 UTC
Nice to hear!

I'm closing this one, as – as far as I understand, correct me if I'm wrong! – this problem is distribution-specific and outside of the KPA's scope.
Comment 10 Alex6 2023-10-27 09:29:30 UTC
Created attachment 162585 [details]
attachment-522009-0.html

Hi,
I'd say it's a (minor) kpa bug that concerns:

- kio-fuse users (I don't know exactly what kio-fuse is for)
- users of distributions which, like Manjaro, install kio-fuse by default.

Personally, I've wasted a lot of time waiting for my images to load or save with gimp, and thanks to your help, finding the origin and solution of the problem.

Thank you for your attention and availability!

Long live kpa, a software that is indispensable to me, and which perhaps suffers from a lack of visibility...

Translated with www.DeepL.com/Translator (free version)


Le vendredi 27 octobre 2023 10:09:25 CEST, vous avez écrit :
> https://bugs.kde.org/show_bug.cgi?id=475976
> 
> Tobias Leupold <tl@stonemx.de> changed:
> 
>            What    |Removed                     |Added
> ----------------------------------------------------------------------------
>              Status|REPORTED                    |RESOLVED
>          Resolution|---                         |DOWNSTREAM
> 
> --- Comment #9 from Tobias Leupold <tl@stonemx.de> ---
> Nice to hear!
> 
> I'm closing this one, as – as far as I understand, correct me if I'm wrong! –
> this problem is distribution-specific and outside of the KPA's scope.
> 
>
Comment 11 Andreas Schleth 2023-10-27 09:51:55 UTC
@Tobias & Johannes: I think closing this bug is a bit premature. 

a) There is still the issue, that dolphin/konqueror show different paths for "open with ..." than KPA in some cases. This is on openSuse - a whole different system than Manjaro. I guess, with more distros shipping KIO-FUSE per default, this problem will pop up again. 

b) "Just uninstall KIO-FUSE" is a temporary measure at best and not a step all users will be comfortable with. With the next system upgrade it will be there again.

I agree, that is is most probably not a problem of KPA itself, but with KIO-FUSE or the whole KIO business. But still ...
KIO-FUSE is pretty new. And this means to me that it certainly has still some bugs to be found. 

What about if you (the main devs) would escalate this business to the KIO-team?
Comment 12 Tobias Leupold 2023-10-27 11:35:03 UTC
Well, then lat's open this again …
Comment 13 Johannes Zarl-Zierl 2023-10-29 20:23:47 UTC
It's good that we have a workaround, but I agree with Andreas - we should at least try to get some insight from the KIO devs on this.
Maybe they can fix this, maybe they can tell us how to fix this. In the worst case we know we can't fix it because it's a downstream problem...

Thanks everybody for gathering insights on this issue!

If nobody is quicker than me I'll ask for help on #kde-devel some time in the upcoming week...