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:

MimeType=image/*;x-scheme-handler/rtsp;video/*;
3 Likes

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]
Type=Application
NoDisplay=true
Name=Gallery
X-MeeGo-Logical-Id=gallery-ap-name
X-MeeGo-Translation-Catalog=gallery
Icon=icon-launcher-gallery
Comment=Sailfish MimeType Handler for Gallery
MimeType=image/
;
X-Maemo-Service=com.jolla.gallery
X-Maemo-Object-Path=/com/jolla/gallery/ui
X-Maemo-Method=com.jolla.gallery.ui.showimage
X-Desktop-File-Install-Version=0.23

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:
X-Maemo-Method=com.jolla.gallery.ui.showimage has to be X-Maemo-Method=com.jolla.gallery.ui.showImages
now, jolla-gallery opens files again, but still open-with-dialogues and duplicated entries…

Have you tried:
MimeType=image/jpeg;image/jpg;image/png;image/jp2;image/webp;

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/

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)