PySide2/QPixmap unable to read Jpeg


I’m running into a curious issue with a tool/package that I’m developing for RV. I’ve just moved over to PySide2 from PySide, but I’ve found that now I’m unable to read .jpg files for use in my UI - which I was able to do before.

Simple example…

from PySide2 import QtGui

pixmap = QtGui.QPixmap("<path to some jpeg>")

Outside of RV, this snipper will print the dimensions of the Jpeg that I’m loading, indicating that the load was successful. Within RV, this will print (0,0), and using the QPixmap.load method will return False.

If I change the image format to .png this this works as expected.

I can’t see any documentation to suggest this is intended behaviour, so assume it’s a bug. Can anyone confirm this behaviour and/or suggest a workaround?

Many thanks!

1 Like