"Python.exe" crashes when PyQt setPixmap () is called using Pixmap

I have a program that sends and receives images to each other using sockets. The server sends the image data using "image.tostring ()" and the client side receives it and returns it back to the image using "Image.fromstring" and then to QImage using "ImageQt.ImageQt (image)", rotates it in QPixmap using "QPixmap.fromimage (qimage)", then updates the QWidget QLable image using "lable.setPixmap (qpixmap)"

Everything works fine with small images, but with images larger than 200x200, python.exe crashes and the console only shows β€œThe process has completed exit code -1073741819” and does not tell me what the problem is.

I isolated the problem before "setPixmap ()" (everything else works as long as I notice it), but I don't see what the problem is.

This only happens on the client side. On the server side, the same steps are used as from Image to QImage to QPixmap and then setPixmap, but this has no problems.

Also tried to make it a QBitmap and use setPixmap on a bitmap that worked (but it is black and white, so can't use it). Weird!

Any help would be appreciated!

+4
source share
1 answer

It might be worth dumping the image data into a file and verify that you have all the data by uploading it to the image viewer. If you get incomplete data, you can still get a QImage and create a QPixmap, but it may not be valid.

0
source

Source: https://habr.com/ru/post/1286589/


All Articles