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.
I managed to make any web browser view images with the following returned in my daemon when it "GET"s a request:
QTextStream os(socket);
os.setAutoDetectUnicode(true);
QByteArray base64 = array.toBase64();
os << "HTTP/1.1 200 Ok\r\n"
"Host: software.local\r\n"
"\r\n"
"<html>"
"<body>"
"<img src=\"data:image/png;base64," << base64 << "\" />"
"</body>";
where "array" is a png's image data; I'm typing something like:
http://software.local:8080/test.png
in to the browser to view the image.
When I try and specify the same URL in my photo source class with something like
[MockPhoto alloc]
initWithURL:@"http://software.local:8080/test.png"
smallURL:@"http://software.local:8080/test.png"
size:CGSizeMake(480, 320)] autorelease],
...
nothing is returned or displayed?
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 "http://software.local/test.png 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.
Any help would great, or better way to do this - I only have basic http experience, as you can see.