Description
When using the Ti.Blob.imageAs methods if they are given a blob that does not represent an image then the application will crash, based off the documentation and other platforms they should not crash but just return null [docs](
http://docs.appcelerator.com/platform/latest/#!/api/Titanium.Blob-method-imageAsResized)
var file = Ti.Filesystem.getFile(Ti.Filesystem.applicationDataDirectory, 'text.txt');
file.write('hi');
var win = Ti.UI.createWindow({
backgroundColor: 'black'
});
var btn = Ti.UI.createButton({
title: 'resized',
top: 10
});
btn.addEventListener('click', function(){
var file2 = Ti.Filesystem.getFile(Ti.Filesystem.applicationDataDirectory, 'text.txt');
var text = file2.read();
var resized = text.imageAsResized(25, 25);;
});
var btn2 = Ti.UI.createButton({
title: 'cropped',
top: 75
});
win.add(btn);
win.open();
Steps to reproduce
1. Using the code above build to a windows device or emulator
Actual result
Application will crash
Expected result
Application should not crash, methods should return null
PR: https://github.com/appcelerator/titanium_mobile_windows/pull/717
Verified using: Windows 10 Pro Ti SDK: 5.4.0.v20160629063537 Appc NPM: 4.2.7-2 Appc CLI: 5.4.0-23 Appc Studio: 4.7.0.201606220541 Lumia 930: 10.0 Lumia 520: 8.1 When using Ti.Blob.imageAs methods on a non-image, the app no longer crashes. Closing ticket