PySide Bugzilla Closed for New Bugs

PySide is now a Qt Add-on and uses the Qt Project's JIRA Bug Tracker instead of this Bugzilla instance. This Bugzilla is left for reference purposes.

Bug 938 - QTemporaryFile JPEG problem
: QTemporaryFile JPEG problem
Status: CLOSED FIXED
Product: PySide
Classification: Unclassified
Component: QtCore
: 1.0.4
: PC All
: P3 normal
Assigned To: Hugo Parente Lima
:
:
:
  Show dependency treegraph
 
Reported: 2011-07-19 14:53 EEST by Lee Smith
Modified: 2011-07-22 22:12 EEST (History)
8 users (show)

See Also:


Attachments
Test program (510 bytes, text/x-python)
2011-07-19 14:53 EEST, Lee Smith
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Lee Smith 2011-07-19 14:53:14 EEST
Created attachment 380 [details]
Test program

When displaying a jpeg retrieved from a url using a QTemporaryFile and QLabel,
I get this message multiple times and no image shown. 

"Corrupt JPEG data: 1 extraneous bytes before marker 0xd9
JPEG datastream contains no image"

It works if I use QTemporaryFile from PyQt4 so I assume it's a bug with
QTemporaryFile.

I've attached a program which shows the problem.
Comment 1 Lee Smith 2011-07-19 16:40:54 EEST
Actually this problem is not specific to the jpeg format since gif, png, and
bmp images also fail to display using the test program.

.png yields the errors "libpng error: Read Error"

.gif and .bmp don't produce any error messages, they just don't show up in the
window.
Comment 2 Hugo Parente Lima 2011-07-20 17:10:32 EEST
The write method is stopping on first null byte.

As workaround you can use:

img.write(QByteArray(response.read()))

Thanks for reporting.
Comment 3 Hugo Parente Lima 2011-07-22 16:50:13 EEST
Fixed in commit:

pyside/3c2505a6254e9446c06dcbc27e5b9d0d8b4316bf
Comment 4 renato filho 2011-07-22 22:12:49 EEST
release 1.0.5