telegramdesktop / tdesktop

Telegram Desktop messaging app
https://desktop.telegram.org/
Other
25.26k stars 5.02k forks source link

QOI format mimetype detection #27009

Closed novomesk closed 8 months ago

novomesk commented 8 months ago

Is your feature request related to a problem?

When I am attaching an image in QOI format, I don't see any preview in Telegram Desktop application despite the fact there is qoi.cpp plug-in from kimageformats.

Describe the solution you'd like

I think the cause it missing mimetype detection in Qt.

image/qoi was added to very new shared-mime-info 2.3 but Qt has old data file bundled-in.

The database was updated in the past via https://github.com/desktop-app/patches/blob/master/qtbase_5.15.10/0023-update-shared-mime-info.patch

The patch updates the database to shared-mime-info-2.2 version (without the patch, JPEG XL didn't work in the past).

So I think, that after upgrading the patches to 2.3 version, the QOI format should probably work afterwards.

Describe alternatives you've considered

n/a

Additional context

Test images: https://qoiformat.org/qoi_test_images.zip

ilya-fedin commented 8 months ago

The patch is made from a Qt commit. Do you have a Qt commit for newer shared-mime-info?

ilya-fedin commented 8 months ago

Looking at Qt's dev branch, last supported shared-mime-info is still 2.2 and that's a blocker. https://github.com/qt/qtbase/commits/dev/src/corelib/mimetypes/mime/packages/freedesktop.org.xml

novomesk commented 8 months ago

They updated it today:

https://github.com/qt/qtbase/commit/889c3e2e5b262071420c0af5f0e1021a9d230320

ilya-fedin commented 8 months ago

Very nice