How to prevent jolla-gallery from opening image/jxl , image/heic and image/avif files?

every time I want to open those filetypes from other apps or system-dialogues SFOS asks me if I want to open it in gallery. That is annoying because gallery is not able to open these files.
Is there a way to stop that behaviour?

In jolla-gallery.desktop, replace the image/* wildcard with just/all the mime types you want Gallery to open:


I haven’t run into this problem, but I would prefer the gallery to properly display those files (at least the ones which are not suffering from patent issues).

hm, in my /usr/share/applications/jolla-gallery.desktop there is no MimeType=image/;
so I changed in /usr/share/applications/jolla-gallery-openfile.desktop
[Desktop Entry]
Comment=Sailfish MimeType Handler for Gallery

MimeType=image/*; to MimeType=image/jpeg;image/png;image/jp2;image/webp;

and I see two effects:
I now get a open-with-dialogue even with jpeg files (with two duplicated jolla-gallery entries)

and jolla-gallery won’t open any file anymore. It just opens the x-Pictures/y-Videos/z-Screenshots overview
when opening via fingerterm it says:
[nemo@Sailfish Pictures]$ jolla-gallery Jolla_01.jpg
SailfishKeyProvider_ini_read: unable to open file
SailfishKeyProvider_storedKey(): error: no scheme or key found for provider/service
and a lot of “Service xyz with data type “Images” will be inactive” messages [xyz=onedrive,dropbox,…]

I am still able to open videos, because internally that seems to happen via jolla-gallery-playvideostrem.desktop

then Display heic/heif files is your thread of interest

okay, the .desktop file was not changed correctly: has to be
now, jolla-gallery opens files again, but still open-with-dialogues and duplicated entries…

Have you tried:

1 Like

hm, filetype image/jpg doesn’t exist, does it?
adding a non-existant filetype here shouldn’t work at all

the command xdg-open in fingerterm behaves correctly:
xdg-open Jolla_01.jpg opens the file via jolla-gallery without open-with-dialogue
xdg-open Jolla_01.jxl opens the file via imageSDLview without open-with-dialogue
and if I change /usr/share/applications/jolla-gallery-openfile.desktop MimeType=… this behaviour changes as it should

but when using GUI-apps (jolla-settings/transmissions or filebrowser/open) the open-with-dialogue from SFOS doesn’t change anymore no matter what value /usr/share/applications/jolla-gallery-openfile.desktop MimeType has:
png/jpeg/jp2/ … supported-jolla-gallery-images show open-with-dialogue with duplicated jolla-gallery entries
jxl/heic/avif non-supported-jolla-gallery-images show open-with-dialogue with one imageSDLview and one jolla-gallery entry

It’s possible that you have to run something like that after changing the .desktop files:

update-desktop-database $HOME/.local/share/applications/
devel-su update-desktop-database /usr/share/applications/
1 Like

yes and after running update-desktop-database the behaviour of xdg-open changes depending on MimeType value in .desktop file as expected
but GUI apps use the SFOS-open-with-dialogue that doesn’t change anymore (before I changed the desktop file the first time, there wasn’t a open-with-dialogue with jpg/png/jp2/webp files, that’s all that changed (first image) and I somehow cannot change it back - the open-with-dialogue in second image didn’t change)

Indeed the image/* on gallery has been a bit too much. Changed that to more limited set of actually supported formats.


On the topic of wildcard mime association, please also have a look at the AppSupport side of things which depending on which apps users have installed can be quite annoying.

the double entries problem finally was finally solved by updating xdg packages to xdg-user-dirs-0.17+git2-1.6.2.jolla.armv7hl.rpm and xdg-utils-1.1.3+git1-1.8.2.jolla.noarch.rpm