Skip to content

Draft: Implement new Windows executable thumbcreator.

This is more-or-less finished proof-of-concept for an improved Windows executable thumbcreator. It is implemented without dependencies and attempting to be memory-safe.

I am posting this now in hopes of receiving feedback. Since I wrote this without any communication to anybody, I have zero expectation it will ever be merged, but I'm happy to rewrite it as much as necessary to make it acceptable. If it is not accepted, I will likely maintain a separate kio plugin on my own instead.

Here's what I believe this improves on:

  • No dependencies
  • Same codepath on all platforms
  • Succeeds at generating thumbnails for some executables that wrestool seems to fail on. (I haven't looked into why yet.)
  • Better performance: Not benched, but MUCH faster at generating thumbnails in a large folder.
  • Network transparency; there's an issue elsewhere in kio/dolphin that makes this not work correctly, so I don't have it enabled yet. (I haven't triaged/reported this issue.)

I think the primary obvious downside is that there is a larger maintenance burden: This code is necessarily more complicated and larger, since unlike either previous codepath it implements parsing Windows PE and NE executables on its own. However, the Windows PE and NE formats have been very stable for a long time, so I think the amount of maintenance that would be necessary should be very minimal and would mostly be related to changes in thumbcreators and kio in general.

I have noticed that Qt ICOReader has at least one bug: for 32bpp icons, the AND mask is not read. This is incorrect; 32bpp icons do have an AND mask and it is sometimes used instead or even in addition to the alpha channel. This affects both the existing and new code, leading to icons having opaque pixels that should be transparent. (Reported to Qt upstream as QTBUG-113319)

One thing I have not done yet is add tests, but I would like to add some autotests for this, if there's any chance it may be accepted in the future.

Edited by John Chadwick

Merge request reports