Problem
When we use Ti.Utils.base64encode() to encode an image blob and then use Ti.Utils.base64decode(), the height and width of the blob are 0. Prior to base 64 encoding the blob, we are able to get the correct height and width properties from the blob.
Test case
var win = Ti.UI.createWindow({
backgroundColor : 'pink'
});
win.open();
var img = Titanium.Filesystem.getFile(Titanium.Filesystem.resourcesDirectory, 'test.png');
var str_blob = img.read();
alert(str_blob.width);
alert(str_blob.height);
var str_64 = Ti.Utils.base64encode(str_blob);
var decoded = Ti.Utils.base64decode(str_64);
alert('Height: ' + decoded.height + 'Width: ' + decoded.width);
Expected behavior
The height and width properties should be available.
base64decode returns a raw data(blob), no mime-type information available.
Occurs because when you base64-encode an image, what you're storing is the image's ORIGINAL size along with the blob, which is what is available. It would be possible to store a modified image as the blob, but that may not always be desired behavior for a number of reasons.
Pedro, encode/decode !== serialize/deserialize Technically, what you need to do prior to reading width/height properties is decoded.mimeType = str_blob.mimeType, but we have no setter for mimeType in the platform. For the File.read, we get mimeType from file name, but it's not stored during encode/decode.
Closing ticket as invalid.