Transfer image over network

hi there,
i look for a way to…

create a simple drawing app with oF for the iPad, that can transfer the results over the network to another computer. two solutions come to my mind:

(1) converting the drawn image to a string and send it over OSC, having another application running as a server, converting it back to an image and saving it

(2) using ofxHttpServer, the other application requests the drawings from the iOS app…

is (1) possible at all?
is (2) possible with iOS? would have to compile libmicrohttpd for iOS i guess

are there other, more elegant solutions?
merci

1 Like

you can use ofxHttpServer in the computer and then ofxHttpUtils on the phone, ofxHttpUtils only depends on Poco which is already included in OF

oh thanks, this is the obvious solution as the other app is not made with oF.

is there any way to directly send an ofImage?

saveImage is not working on iOS unfortunately…
false alarm–forgot xcode 4 isn’t using the development directory for simulator builds anymore…

haven’t tried, but it should be possible, in ofxHttpUtils, it uses a FilePartSource when attaching a file to the request, i guess there’s some other kind of PartSource that allows to send data without reading it from a file. This will also need to add a method to ofImage to get the compressed data to memory in an ofBuffer (007), which would be a useful addition