Bug 442185 - j2k and jp2 without file extension appears in file dialog filter dropdown
Summary: j2k and jp2 without file extension appears in file dialog filter dropdown
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: File formats (show other bugs)
Version: git master (please specify the git hash!)
Platform: Microsoft Windows Microsoft Windows
: NOR normal
Target Milestone: ---
Assignee: wolthera
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-09-08 16:30 UTC by Alvin Wong
Modified: 2021-10-21 20:31 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
File type dropdown (23.60 KB, image/png)
2021-09-08 16:30 UTC, Alvin Wong
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alvin Wong 2021-09-08 16:30:38 UTC
Created attachment 141403 [details]
File type dropdown

The open file dialog shows two weird items:

- j2k (*)
- jp2 (*)

... in addition to the normal "JPEG-2000 image (*.jp2 *.jpx *.jpf)".

In the shared-mime-info bundled with Qt [1], JPEG-2000 comes in these mime types:

- image/jp2
- image/jpeg2000
- image/jpx
- image/jpeg2000-image
- image/x-jpeg2000-image

... and these file extension glob patterns:

- *.jp2
- *.jpx
- *.jpf

On the other hand, Krita's desktop file [2] has:

- MimeType=image/x-jp2;image/x-j2k

... and the import plugin JSON [3] has:

- "X-KDE-Import": "image/jp2,image/j2k,image/x-jp2,image/x-j2k"
- "X-KDE-Extensions" : "jp2,j2k"

I am guessing that image/j2k, image/x-jp2 and image/x-j2k are the cause.


[1]: https://invent.kde.org/qt/qt/qtbase/-/blob/v5.12.11/src/corelib/mimetypes/mime/packages/freedesktop.org.xml
[2]: https://invent.kde.org/graphics/krita/-/blob/8977dc9bb2cf2e68cd5d092111b2818ed97bfac0/plugins/impex/jp2/krita_jp2.desktop#L117
[3]: https://invent.kde.org/graphics/krita/-/blob/8977dc9bb2cf2e68cd5d092111b2818ed97bfac0/plugins/impex/jp2/krita_jp2_import.json#L6
Comment 1 wolthera 2021-09-21 15:08:22 UTC
Git commit 0986afac2fe3351e4d70fdee946952efaf7caa56 by Wolthera van Hövell tot Westerflier.
Committed on 21/09/2021 at 15:06.
Pushed by woltherav into branch 'krita/5.0'.

Fix task set docker text appearance.

1. Text color should be set with pen, not brush.
2. Also polishes the height a bit.

M  +1    -1    libs/widgets/KisPaletteChooser.cpp
M  +5    -4    plugins/dockers/tasksetdocker/tasksetdocker_dock.cpp

https://invent.kde.org/graphics/krita/commit/0986afac2fe3351e4d70fdee946952efaf7caa56
Comment 2 wolthera 2021-09-21 15:09:15 UTC
Git commit 7b7ec23a048be967577034795406446ff70abc70 by Wolthera van Hövell, on behalf of Wolthera van Hövell tot Westerflier.
Committed on 21/09/2021 at 15:09.
Pushed by woltherav into branch 'master'.

Fix task set docker text appearance.

1. Text color should be set with pen, not brush.
2. Also polishes the height a bit.


(cherry picked from commit 0986afac2fe3351e4d70fdee946952efaf7caa56)

M  +1    -1    libs/widgets/KisPaletteChooser.cpp
M  +5    -4    plugins/dockers/tasksetdocker/tasksetdocker_dock.cpp

https://invent.kde.org/graphics/krita/commit/7b7ec23a048be967577034795406446ff70abc70
Comment 3 wolthera 2021-09-21 15:10:31 UTC
Whoops, wrong bug...
Comment 4 wolthera 2021-09-21 15:17:48 UTC
The problem I think is that the mimetypes have been disabled on the mimedatabase but not the plugin itself in commit 8e2c2dd46ac66a50f3daa42203143c758da13d18 ...

I guess we should report this bug to openjpeg and ask them what should be the official list of mime-types and file extensions? Because it was an openjpeg contributor who contributed the plugin...
Comment 5 wolthera 2021-09-21 15:28:46 UTC
I'll take this for now.
Comment 6 Bug Janitor Service 2021-10-21 16:44:02 UTC
A possibly relevant merge request was started @ https://invent.kde.org/graphics/krita/-/merge_requests/1117
Comment 7 amyspark 2021-10-21 20:29:20 UTC
Git commit 4cc3e8bb708cada07eb4f5c152d78a7f22e91aa8 by L. E. Segovia.
Committed on 21/10/2021 at 16:41.
Pushed by lsegovia into branch 'master'.

Update JPEG2000 file extensions

See https://datatracker.ietf.org/doc/html/rfc3745

M  +14   -7    plugins/impex/jp2/jp2_converter.cc
M  +1    -1    plugins/impex/jp2/krita_jp2.desktop
M  +2    -2    plugins/impex/jp2/krita_jp2_import.json

https://invent.kde.org/graphics/krita/commit/4cc3e8bb708cada07eb4f5c152d78a7f22e91aa8
Comment 8 amyspark 2021-10-21 20:31:10 UTC
Git commit f5d2052f4e07ecde6d43f07b943c6294c31e5ba9 by L. E. Segovia.
Committed on 21/10/2021 at 20:30.
Pushed by lsegovia into branch 'krita/5.0'.

Update JPEG2000 file extensions

See https://datatracker.ietf.org/doc/html/rfc3745
(cherry picked from commit 4cc3e8bb708cada07eb4f5c152d78a7f22e91aa8)

M  +14   -7    plugins/impex/jp2/jp2_converter.cc
M  +1    -1    plugins/impex/jp2/krita_jp2.desktop
M  +2    -2    plugins/impex/jp2/krita_jp2_import.json

https://invent.kde.org/graphics/krita/commit/f5d2052f4e07ecde6d43f07b943c6294c31e5ba9