Solved QPixmap.loadFromData() fails
-
I'm reading images from a web cam as JPGs.
It was working on devel machine, but it fails on user's pc.If I store the received QByteArray in a *.PNG file is displayed correctly.
Any advice how to approach the issue is welcome.
-
@gkavrecic It seems that the end user web cam is configured to send PNG not JPG!
So, change web cam configuration or you code the load load as PNG not JPG
-
@gkavrecic
do not let the QImageReader guess, and specify the format duringloadFromData
call -
Sorry for not specifying this:
The same HW is used.
It is the same cam used and same software.
Currently I've added to write qbytearray to a file when the conversion loadFromData fails.
It would probably work if I change it to *.JPG -
@J.Hilk
I tought of this, but what could influence the different bahaviour? -
Hi,
Since it's not working on the user's pc, how do you provide him with the executable ?
Did you forget to bundle the plugins with it ?
From the look of it, you are missing the JPEG image format plugin.
PNG is built-in.
-
@SGaist, if you mean static or shared libs - shared
It might be that some DLL is missing.
Would you propose one? -
@gkavrecic @SGaist means JPEG plug-in delivered with Qt (check plugins/imageformats directory in your Qt setup).
-
It was missing the qjpeg.dll
Thanks for the hints