Bug 380956 - Re-add support for .dds textures
Summary: Re-add support for .dds textures
Status: RESOLVED FIXED
Alias: None
Product: frameworks-kimageformats
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: unspecified
Platform: Other Linux
: NOR wishlist
Target Milestone: ---
Assignee: Alex Merry
URL:
Keywords:
: 428819 (view as bug list)
Depends on:
Blocks:
 
Reported: 2017-06-08 03:15 UTC by tguen
Modified: 2024-12-24 09:00 UTC (History)
4 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description tguen 2017-06-08 03:15:31 UTC
kimageformats supported .dds files at one time, but support was removed when Qt added supprt for them. Qt has since removed support, leaving me unable to open these files.

https://cgit.kde.org/kimageformats.git/commit/?id=e5fce91de6ef72f15c7d31b16b2494f534c7157c

https://bugreports.qt.io/browse/QTBUG-59955
Comment 1 Christoph Feck 2020-11-08 05:47:45 UTC
*** Bug 428819 has been marked as a duplicate of this bug. ***
Comment 2 Mirco Miranda 2024-11-24 09:01:08 UTC
@Albert, do you think we can fork their version from Qt and then patch it. I checked and it's better than the old one that was in KIF.

If so, can we fork an LGPL3 or do we have to look for an LGPL2 version?

They don't maintain the DSS plugin anymore...
Comment 3 Albert Astals Cid 2024-11-25 21:51:45 UTC
Have you seen Giuseppe's comment? I'm not super happy with the "full of security issues" and with the "DDS isn't really an image" comments.
Comment 4 Mirco Miranda 2024-11-26 00:12:06 UTC
(In reply to Albert Astals Cid from comment #3)
> Have you seen Giuseppe's comment? I'm not super happy with the "full of
> security issues" and with the "DDS isn't really an image" comments.

Yes I saw, my intention was to put it on OSS fuzz before enabling it and then fix it.
Anyway it was just an idea...
Comment 5 Albert Astals Cid 2024-11-27 23:07:22 UTC
If you really like to try this tell me we can ask The Qt Company if they would be willing to relicense that bit of code to LGPL2 for us (not sure if they will agree), i would rather not add a plugin with a different license of all the rest
Comment 6 Mirco Miranda 2024-11-28 07:17:53 UTC
(In reply to Albert Astals Cid from comment #5)
> If you really like to try this tell me we can ask The Qt Company if they
> would be willing to relicense that bit of code to LGPL2 for us (not sure if
> they will agree), i would rather not add a plugin with a different license
> of all the rest

I agree. We need GPL 2.x. I checked and the version of the DDS plugin included in Qt 5.6 is GPL2.1. Also it has no code differences compared to the version included in 5.15. Do you think it is possible to proceed using the Qt 5.6 version?

https://github.com/qt/qtimageformats/blob/5.6/src/plugins/imageformats/dds/qddshandler.cpp
Comment 7 Albert Astals Cid 2024-11-28 08:24:44 UTC
Note we need LGPL2 not GPL2, but yes, that file is LGPL2 so we could fork from that one if we want.
Comment 8 Mirco Miranda 2024-11-28 09:56:08 UTC
(In reply to Albert Astals Cid from comment #7)
> Note we need LGPL2 not GPL2, but yes, that file is LGPL2 so we could fork
> from that one if we want.

Yes of course, I searched for LGPL but I wrote GPL... 
well, I'll put it in the queue for work.
Comment 9 Bug Janitor Service 2024-11-29 09:14:19 UTC
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/kimageformats/-/merge_requests/282
Comment 10 Mirco Miranda 2024-12-11 06:45:04 UTC
Git commit 87eff569a4ba0c8ef81be2501bbad0f0e0c21de2 by Mirco Miranda.
Committed on 11/12/2024 at 06:45.
Pushed by mircomir into branch 'master'.

Re-added DDS plugin support

Fork of [Qt 5.6 DDS plugin](https://code.qt.io/cgit/qt/qtimageformats.git/tree/src/plugins/imageformats/dds/qddshandler.cpp?h=5.6) under LGPL2.1.

- Merged all files in dds_p.h and dds.cpp
- Added support for Qt 6 image allocation limit
- Added checks for null image and datastream errors
- The plugin is disabled by default

Closes: #12

M  +1    -1    .kde-ci.yml
M  +4    -0    CMakeLists.txt
M  +14   -0    README.md
M  +5    -0    autotests/CMakeLists.txt
A  +-    --    autotests/read/dds/indexed.dds
A  +-    --    autotests/read/dds/indexed.png
A  +-    --    autotests/read/dds/rgba.dds
A  +-    --    autotests/read/dds/rgba.png
A  +-    --    autotests/read/dds/rgba102.dds
A  +-    --    autotests/read/dds/rgba102.png
A  +-    --    autotests/read/dds/rgba4.dds
A  +-    --    autotests/read/dds/rgba4.png
A  +-    --    autotests/read/dds/rgba5551.dds
A  +-    --    autotests/read/dds/rgba5551.png
A  +-    --    autotests/read/dds/rgba_abgr.dds
A  +-    --    autotests/read/dds/rgba_abgr.png
A  +-    --    autotests/read/dds/rgba_bc1.dds
A  +-    --    autotests/read/dds/rgba_bc1.png
A  +-    --    autotests/read/dds/rgba_bc2.dds
A  +-    --    autotests/read/dds/rgba_bc2.png
A  +-    --    autotests/read/dds/rgba_bc3.dds
A  +-    --    autotests/read/dds/rgba_bc3.png
A  +-    --    autotests/read/dds/rgba_f16.dds
A  +-    --    autotests/read/dds/rgba_f16.png
A  +-    --    autotests/read/dds/rgba_f32.dds
A  +-    --    autotests/read/dds/rgba_f32.png
A  +-    --    autotests/write/basic/rgb.dds
A  +-    --    autotests/write/basic/rgba.dds
A  +-    --    autotests/write/format/dds/Format_A2BGR30_Premultiplied.dds
A  +-    --    autotests/write/format/dds/Format_A2RGB30_Premultiplied.dds
A  +-    --    autotests/write/format/dds/Format_ARGB32.dds
A  +-    --    autotests/write/format/dds/Format_ARGB32_Premultiplied.dds
A  +-    --    autotests/write/format/dds/Format_ARGB4444_Premultiplied.dds
A  +-    --    autotests/write/format/dds/Format_ARGB6666_Premultiplied.dds
A  +-    --    autotests/write/format/dds/Format_ARGB8555_Premultiplied.dds
A  +-    --    autotests/write/format/dds/Format_ARGB8565_Premultiplied.dds
A  +-    --    autotests/write/format/dds/Format_BGR30.dds
A  +-    --    autotests/write/format/dds/Format_BGR888.dds
A  +-    --    autotests/write/format/dds/Format_CMYK8888.dds
A  +-    --    autotests/write/format/dds/Format_Grayscale16.dds
A  +-    --    autotests/write/format/dds/Format_Grayscale8.dds
A  +-    --    autotests/write/format/dds/Format_Indexed8.dds
A  +-    --    autotests/write/format/dds/Format_Mono.dds
A  +-    --    autotests/write/format/dds/Format_MonoLSB.dds
A  +-    --    autotests/write/format/dds/Format_RGB16.dds
A  +-    --    autotests/write/format/dds/Format_RGB30.dds
A  +-    --    autotests/write/format/dds/Format_RGB32.dds
A  +-    --    autotests/write/format/dds/Format_RGB444.dds
A  +-    --    autotests/write/format/dds/Format_RGB555.dds
A  +-    --    autotests/write/format/dds/Format_RGB666.dds
A  +-    --    autotests/write/format/dds/Format_RGB888.dds
A  +-    --    autotests/write/format/dds/Format_RGBA16FPx4.dds
A  +-    --    autotests/write/format/dds/Format_RGBA16FPx4_Premultiplied.dds
A  +-    --    autotests/write/format/dds/Format_RGBA32FPx4.dds
A  +-    --    autotests/write/format/dds/Format_RGBA32FPx4_Premultiplied.dds
A  +-    --    autotests/write/format/dds/Format_RGBA64.dds
A  +-    --    autotests/write/format/dds/Format_RGBA64_Premultiplied.dds
A  +-    --    autotests/write/format/dds/Format_RGBA8888.dds
A  +-    --    autotests/write/format/dds/Format_RGBA8888_Premultiplied.dds
A  +-    --    autotests/write/format/dds/Format_RGBX16FPx4.dds
A  +-    --    autotests/write/format/dds/Format_RGBX32FPx4.dds
A  +-    --    autotests/write/format/dds/Format_RGBX64.dds
A  +-    --    autotests/write/format/dds/Format_RGBX8888.dds
M  +6    -0    src/imageformats/CMakeLists.txt
A  +1933 -0    src/imageformats/dds.cpp     [License: LGPL(v3.0) LGPL(v2.1)]
A  +4    -0    src/imageformats/dds.json
A  +143  -0    src/imageformats/dds_p.h     [License: LGPL(v3.0) LGPL(v2.1)]

https://invent.kde.org/frameworks/kimageformats/-/commit/87eff569a4ba0c8ef81be2501bbad0f0e0c21de2
Comment 11 Mirco Miranda 2024-12-11 07:19:06 UTC
And finally the PR OSS Fuzz: https://github.com/google/oss-fuzz/pull/12832
Comment 12 Mirco Miranda 2024-12-24 09:00:37 UTC
DDS plugin is now enabled by default.