<div dir="ltr">Hm, equivalent programs in Qt 6.2.0 (C++) and PySide6 6.2.0 both work fine, and I'm not familiar enough with PyQt's code to try to debug it there. Guess there's not much I can do, then :/<div><br></div><div>Thanks for looking into it.</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Oct 15, 2021 at 6:41 AM Phil Thompson <<a href="mailto:phil@riverbankcomputing.com">phil@riverbankcomputing.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On 15/10/2021 07:14, RoadrunnerWMC wrote:<br>
> Hi Phil,<br>
> <br>
> I believe I found a bug in PyQt6. Test case is very simple:<br>
> <br>
> from PyQt6 import QtCore, QtGui, QtWidgets<br>
> <br>
> app = QtWidgets.QApplication([])<br>
> <br>
> img = QtGui.QImage(b'\xff' * (256 * 256 * 4), 256, 256,<br>
>> QtGui.QImage.Format.Format_ARGB32)<br>
> <br>
> img.save('test.png')<br>
> <br>
> <br>
> In PyQt5 5.15.4 (adjust the import line to test it), this correctly <br>
> saves a<br>
> white 256x256 png in the current directory.<br>
> In PyQt6 6.2.0 on Ubuntu 20.04, this segfaults on the last line.<br>
> In PyQt6 6.2.0 on Windows 10, it doesn't crash, but the output is a <br>
> corrupt<br>
> image (example attached). I can also make it sometimes do the same on<br>
> Ubuntu by playing with the QImage constructor arguments.<br>
> <br>
> Let me know if you need any more info.<br>
> <br>
> Thanks,<br>
> RoadrunnerWMC<br>
<br>
I can reproduce this on Linux but it works on macOS. The core dump is <br>
within the Qt code so I suspect it's a Qt bug.<br>
<br>
Phil</blockquote></div>