Hmmm… Here’s me, trying to re-invent the wheel, again. At least I learn a lot on the way. I’ll check it out, as soon as I get a chance, and report back.
Thank you for being awesome, @britzl!
Edit: And sorry for being stupid. I looked at the API reference again, and noticed that my brain hadn’t caught on to what it said about return values… http://www.defold.com/ref/image/