Note that there are some explanatory texts on larger screens.

plurals
  1. POServing PNG images over http to Three20 iPhone app
    primarykey
    data
    text
    <p>I'm trying to serve up png images from a Linux (c++ / Qt4.5.x) server daemon to an iPhone application that is using the Three20 framework - specifically I want to use the TTThumbsViewController view.</p> <p>I managed to make any web browser view images with the following returned in my daemon when it "GET"s a request:</p> <pre><code>QTextStream os(socket); os.setAutoDetectUnicode(true); QByteArray base64 = array.toBase64(); os &lt;&lt; "HTTP/1.1 200 Ok\r\n" "Host: software.local\r\n" "\r\n" "&lt;html&gt;" "&lt;body&gt;" "&lt;img src=\"data:image/png;base64," &lt;&lt; base64 &lt;&lt; "\" /&gt;" "&lt;/body&gt;"; </code></pre> <p>where "array" is a png's image data; I'm typing something like:</p> <pre><code> http://software.local:8080/test.png </code></pre> <p>in to the browser to view the image.</p> <p>When I try and specify the same URL in my photo source class with something like</p> <pre><code>[MockPhoto alloc] initWithURL:@"http://software.local:8080/test.png" smallURL:@"http://software.local:8080/test.png" size:CGSizeMake(480, 320)] autorelease], ... </code></pre> <p>nothing is returned or displayed?</p> <p>My question is really - if I put say test.png in a suitable directory on the Linux PC and start a web server (apache), then browse to "<a href="http://software.local/test.png" rel="nofollow noreferrer">http://software.local/test.png</a> I see the image as above, but the image was not embedded in the http header? I really can't figure out what the header should be to get this behaviour. If I set the URL in the above iPhone code so it loads the png from the apache server I see it in the TTThumbsViewController.</p> <p>Any help would great, or better way to do this - I only have basic http experience, as you can see. </p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload