Bug 389650 - Open with Krita does not appear in right click menu
Summary: Open with Krita does not appear in right click menu
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: General (show other bugs)
Version: 3.3.3
Platform: Microsoft Windows Microsoft Windows
: NOR wishlist
Target Milestone: ---
Assignee: Alvin Wong
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-01-30 17:05 UTC by brandmairstefan+krita
Modified: 2018-03-01 15:36 UTC (History)
3 users (show)

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


Attachments
Open With Menu (65.55 KB, image/png)
2018-01-30 17:05 UTC, brandmairstefan+krita
Details
probable patch 1 (example) (3.86 KB, text/plain)
2018-01-31 15:51 UTC, Alvin Wong
Details

Note You need to log in before you can comment on or make changes to this bug.
Description brandmairstefan+krita 2018-01-30 17:05:12 UTC
Created attachment 110228 [details]
Open With Menu

What happened:
When right clicking on an image file (such as .png), Krita does not show up in the "Open With" menu. In fact, it doesn't even show up in the "How do you want to open this file?" menu. You have to press on the "More apps" button and scroll down to find Krita as an option.

Expected result:
Krita should be an option in the "Open With" menu for all image files that Krita can open.


Probable Cause:
This probably has something to do with a bunch of registry settings. I was able to get Krita to show up in the "How do you want to open this file?" menu by adding ".jpg" and ".png" to "Computer\HKEY_CLASSES_ROOT\Applications\krita.exe\SupportedTypes" (System Registry Path)


Extra information:
This bug has been reported on the kde forums a few months ago: https://forum.kde.org/viewtopic.php?f=281&t=142451
I recently re-installed Krita, so, I suppose that the bug is not fixed yet.
Comment 1 Halla Rempt 2018-01-31 08:14:23 UTC
If I understand the forum discussion correctly, this has never been the case, so I'm setting the to wish and confirmed.
Comment 2 Alvin Wong 2018-01-31 14:19:14 UTC
> I can't even find where those registrations are done: did you already
> put the krita installer sources in the krita git repo, or are those
> still the old ones done by Stuart?

Well, they are in this pile of spaghetti:
https://github.com/alvinhochun/KritaShellExtension/blob/master/installer/nsis/krita_shell_integration.nsh

Of course, being Windows the file associations are derived from a pile of registry mess. These are maybe the points of interest (though all the other values are as important):
https://github.com/alvinhochun/KritaShellExtension/blob/db269ae5ec0466aa88722d9559bf0f6fb651d9d7/installer/nsis/krita_shell_integration.nsh#L148
https://github.com/alvinhochun/KritaShellExtension/blob/db269ae5ec0466aa88722d9559bf0f6fb651d9d7/installer/nsis/krita_shell_integration.nsh#L166

Apparently I did not keep the links that I referred to over a year and a half ago. This would be the current documentation: https://msdn.microsoft.com/en-us/library/windows/desktop/cc144104(v=vs.85).aspx

It's not exactly as simple as just adding the values to "SupportedTypes", by the way; or maybe it is but I can't tell before re-reading all the MSDN pages about it...
Comment 3 Alvin Wong 2018-01-31 14:44:28 UTC
Can someone suggest a list of file extensions to have Krita to be added to the open with dialog? (Not as default program.) These are what I can think of:

- .jpg/.jpeg
- .png
- .gif
- .tif/.tiff
- .psd
- .xcf
- .kpp

I want to limit the list to file types that are common enough and those which Krita will most certainly support even in the future.
Comment 4 Halla Rempt 2018-01-31 14:47:33 UTC
This is the full list, and all of them are stable import plugins. The important ones missing in your list are exr and maybe bmp -- the rest are very obscure.
 
boud@linux-s09k:~/dev/krita> find . -name \*json | grep import | xargs grep X-KDE-Extensions
./plugins/impex/brush/krita_brush_import.json:    "X-KDE-Extensions" : "gih,gbr"
./plugins/impex/tga/krita_tga_import.json:    "X-KDE-Extensions" : "tga"
./plugins/impex/pdf/krita_pdf_import.json:    "X-KDE-Extensions" : "pdf"
./plugins/impex/tiff/krita_tiff_import.json:    "X-KDE-Extensions" : "tif,tiff"
./plugins/impex/xcf/krita_xcf_import.json:    "X-KDE-Extensions" : "xcf"
./plugins/impex/csv/krita_csv_import.json:    "X-KDE-Extensions" : "csv"
./plugins/impex/png/krita_png_import.json:    "X-KDE-Extensions" : "png,kpp"
./plugins/impex/ppm/krita_ppm_import.json:    "X-KDE-Extensions" : "ppm"
./plugins/impex/psd/krita_psd_import.json:    "X-KDE-Extensions" : "psd,psb"
./plugins/impex/heightmap/krita_heightmap_import.json:    "X-KDE-Extensions" : "r32,r16,r8"
./plugins/impex/odg/krita_odg_import.json:    "X-KDE-Extensions" : "odf"
./plugins/impex/kra/krita_kra_import.json:    "X-KDE-Extensions" : "kra"
./plugins/impex/jpeg/krita_jpeg_import.json:    "X-KDE-Extensions" : "jpg,jpeg"
./plugins/impex/raw/krita_raw_import.json:    "X-KDE-Extensions" : "nef,cr2,sr2,crw,pef,x3f,kdc,mrw,arw,k25,dcr,orf,raw,raw,raf,srf,dng"
./plugins/impex/svg/krita_svg_import.json:    "X-KDE-Extensions" : "svg"
./plugins/impex/exr/krita_exr_import.json:    "X-KDE-Extensions" : "exr"
./plugins/impex/ora/krita_ora_import.json:    "X-KDE-Extensions" : "ora"
./plugins/impex/bmp/krita_bmp_import.json:    "X-KDE-Extensions" : "bmp,gif,webp,xbm,ico"
Comment 5 Alvin Wong 2018-01-31 15:51:38 UTC
Created attachment 110265 [details]
probable patch 1 (example)

The changes would probably be something like this.

Because I'm lazy-ass, I plan to just use one progid "Krita.GenericImage" for all the other image types. Wwell except for .kpp, this one I might give it a special entry like "Krita.PainttopPreset" and maybe even make Krita the default program.

The uninstaller is probably not able to clean up everything properly if someone manually assign Krita as the default program for those other filetypes though. I don't want to imagine the registry mess Windows decides to create.
Comment 6 Halla Rempt 2018-02-01 10:38:11 UTC
That's probably fine, I guess.
Comment 8 Halla Rempt 2018-02-28 17:53:50 UTC
Hi Alvin,

Should we do something to make sure the new version gets packaged with the installer correctly?
Comment 9 Alvin Wong 2018-02-28 18:28:23 UTC
(In reply to Boudewijn Rempt from comment #8)
> Hi Alvin,
> 
> Should we do something to make sure the new version gets packaged with the
> installer correctly?

I will rebuild the shell extension with debug info and make a new release of it some time this week. then I can update the packaging scripts in the Krita source to point to the new release.
Comment 10 Alvin Wong 2018-03-01 15:36:58 UTC
Git commit 6eb59967e4015505df2acca947786380d06c8dd5 by Alvin Wong.
Committed on 01/03/2018 at 15:35.
Pushed by alvinwong into branch 'master'.

Windows: Update krita-nsis to v1.2.4b

Changelog:
- Add Krita to the Open With list for other common image formats
  [alvinhochun/KritaShellExtension#15]
- Build shell extension with debug info
  [alvinhochun/KritaShellExtension#16]

M  +2    -2    packaging/windows/MakeInstallerNsis.cmake.in

https://commits.kde.org/krita/6eb59967e4015505df2acca947786380d06c8dd5