| Summary: | Instance of a corrupted image with kitty and iterm2 protocol | ||
|---|---|---|---|
| Product: | [Applications] konsole | Reporter: | Henner Zeller <h.zeller> |
| Component: | general | Assignee: | Konsole Bugs <konsole-bugs-null> |
| Status: | REPORTED --- | ||
| Severity: | normal | CC: | matan |
| Priority: | NOR | ||
| Version First Reported In: | 24.12.0 | ||
| Target Milestone: | --- | ||
| Platform: | Other | ||
| OS: | Linux | ||
| Latest Commit: | Version Fixed/Implemented In: | ||
| Sentry Crash Report: | |||
| Attachments: | A tar file with the original and (kitty and iterm2)-encoded form, as well as a screenshot | ||
|
Description
Henner Zeller
2025-01-03 14:14:47 UTC
This seems to me to be a Qt6 bug. Trying to open the PNG file in kolourpaint (Fedora 40) results in the same garbled image. Converting the file from png to png using graphics magick results in a slightly smaller file that works in konsole (and in kolourpaint). Interesting. I can also confirm that Version 24.12.1 of `kolourpaint` also shows the png garbled ... but only on one of my machines, but correctly on another machine (Both running NixOS. Both machines show the issue on the konsole).
Might indicate some non-initialized value/buffer overflow somewhere ?
To test if this is an issue with Qt `QImage`, I've compiled the following super-simple program in Qt5 and Qt6 to see if the image loading is an issue there.
Both show `bug/original-image.png` correctly. So it does _not_ look like something with basic QImage.
I made it as self-compiling c++ 'script', for ease of reproducability (Replace Qt6 with Qt5 in the pkg-config call to compile with qt5):
```c++
#if 0 // Invoke with /bin/sh or simply add executable bit on this file on Unix.
B=${0%%.cc}; [ "$B" -nt "$0" ] || c++ -o"$B" "$0" $(pkg-config --cflags --libs Qt6Widgets) && exec "$B" "$@";
#endif
#include <QApplication>
#include <QLabel>
#include <QPixmap>
int main(int argc, char *argv[]) {
QApplication app(argc, argv);
const char *path = argc > 1 ? argv[1] : "bug/original-image.png";
QPixmap image(path);
QLabel imageLabel;
imageLabel.setPixmap(image);
imageLabel.show();
return app.exec();
}
```
So maybe not a Qt issue, but whatever image loading `kolourpaint` and `konsole` use to decode images is the culprit. And the inconsistency
above I say QImage, but use QPixmap for the label. But the same successful outcome is with QImage. (In reply to Henner Zeller from comment #3) > So maybe not a Qt issue, but whatever image loading `kolourpaint` and > `konsole` use to decode images is the culprit. And the inconsistency This PNG file is also corrupted on konsole/kolourpaint 23.08.5 with Qt5. Konsole gets a byte stream from the program running in the terminal, and passes it to Qt. Maybe it is better to report this bug to kolourpaint. Displaying an image is more of a core functionality for them, so they might have more experience with handling such bug. |