Example using image(data)?

Hi, have anyone used image(data)? What format should it be, any convenient tools for converting an image, or code maybe? I guess it is nice to embed an image in example code.

I believe this would be the raw bytes (string) in a particular format supported by iOS. Such as the raw PNG data, JPEG data, or one of the other supported formats.

This is mostly used automatically when fetching images from the web with http.request (the data string is automatically transformed into an image type, if possible).

@Simeon - is there a way to go the other direction? ie. get the raw bytes back from a given image to, say, upload?

I’ve been saving to local documents, then using the file API, but it’s ugly. Oh, so ugly.

That’s probably the only way for now — to use io.* after saving the image down to disc in PNG format.