I'm trying to capture an image from a VideoPlayer view using the toImage() method in android. The method returns a blob, but I can't save it -- the system doesn't believe that it's an image blob. Here's the code:
var blobThumb = player.toImage(); Ti.API.info('BLOB: ' + JSON.stringify(blobThumb)); var tempImg = Ti.Filesystem.getFile(Ti.Filesystem.applicationDataDirectory, 'temp_photo.png'); tempImg.write(blobThumb);And here's the output, including errors:
[INFO] : I/dalvikvm-heap: Grow heap (frag case) to 28.254MB for 7171216-byte allocation [INFO] : blob length: undefined [WARN] : TiBlob: (KrollRuntimeThread) [29329,39673] getFile not supported for non-file blob types. [WARN] : TiBlob: (KrollRuntimeThread) [1,39674] getNativePath not supported for non-file blob types. [INFO] : blob info: {"cropRect":{"height":1494,"width":1200,"x":0},"height":1494,"media":{"file":null,"nativePath":null,"height":1494,"length":7059,"width":1200,"mimeType":"image/png","apiName":"Ti.Blob","text":null,"type":2,"bubbleParent":true},"mimeType":"image/png","y":0,"width":1200,"x":0} [INFO] : TiFileProxy: (KrollRuntimeThread) [1,39675] Unable to write to an unrecognized file type [INFO] : TiFileProxy: (KrollRuntimeThread) [10,39685] Unable to write to an unrecognized file typeThe object data suggests it is an image file, though the blob length says zero. And I have no idea what the "grow heap" message means. I'm using Titanium SDK version 3.4.0.GA.