PDA

View Full Version : Corrupt JPEG data



probine
13th January 2007, 15:33
I know that QHttp is able to retrieve data from web servers. I have use it and I can display different websites in a QTextBrowser.

How can I get just 1 image from any web server with QHttp ?

Sp far, I can connect to a web server. The data received is saved in a QByteArray, but I cannot show the image.

I get this error:

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

camel
13th January 2007, 15:37
Could you please stop opening a new Thread every day for the same problem?

Instead please answer the questions I asked you to in your last thread so that it is possible to help you as you are not giving enough information here to solve your problem.

probine
13th January 2007, 16:02
I have told you:

The image is accessible from any browser.
The image is valid .jpg or .png
The image is stored in my QByteArray.

For some reason it is not shown.

camel
13th January 2007, 16:12
I have told you:

The image is accessible from any browser.
The image is valid .jpg or .png
The image is stored in my QByteArray.

For some reason it is not shown.

Yes, but actually those pieces of information is not what I asked for. (Nor do they help much at this point)

A few questions that might help me help you:

Did it work trying to display it in the label? (it was commented out in your code) What happened if it did not work?
Do you have any conversions QByteArray -> QString? (for example in site.append())
Doesn't the loadResource (http://www.qtcentre.org/forum/f-qt-programming-2/t-how-to-display-images-in-qtextbrowser--5155.html) method work? What happens if you try it? What is the problem with it?
Have you tried to write out the contents of the QByteArray to a file? What does the content look like? Could you display that file?