Problem Description
Blob which returned by toImage Method has undefined mimeType in Android. In iOS is working fine.
Steps to reproduce
1. Create a new mobile project
2. Add support for android
3. Paste the code into app.js
var view = Ti.UI.createView({
width : 100 ,
height :100,
backgroundColor:'blue'
});
var blob = view.toImage();
alert('blob.width:' + blob.width +
'\n blob.height:' + blob.height +
'\n blob.mimeType:' + blob.mimeType);
Expected Behavior:
{panel:title=Expected Alert Message}
blob.width : 100
blob.height : 100
blob.mimeType : image/png
{panel}
Actual Behavior:
iOS work properly, Buy Android alert below message
{panel:title=Actual Alert Message}
blob.width : 100
blob.height : 100
blob.mimeType : undefined
{panel}
Added mimetype to the krollDict that is returned https://github.com/appcelerator/titanium_mobile/pull/4999
Verified the issue. Working as expected. Getting correct mimeType using toImage Method for blob Object on both Android and iOS. Appc-Studio:3.2.3.201404162038 sdk:3.3.0.v20140417173316 acs:1.0.14 alloy:1.3.1 npm:1.3.2 titanium:3.2.3-beta titanium-code-processor:1.1.1-beta1 xCODE:5.1.1 Device:Nexus7(v4.4.2),Iphone5(v7.1) Hence closing the issue.
Has the fix been released in 3.3.0? I am still seeing this issue on my Samsung S4. Can anyone confirm that this fix is working on Samsung devices? From my experience Samsung butchers Android (especially when it comes image media) but since they're such a major player we need this work. I think this issue should be reopened or let me know how I can get the fix. Device: Samsung Galaxy S4 SGH-I337M Android Version: 4.4.2 Environment: Titanium Studio : 3.3.0.201407100905 Titanium SDK : 3.3.0.GA CLI : 3.3.0 Alloy: 1.4.1 Mac OSX 10.9.4
Never mind. I just had to change the Titanium SDK in my tiapp.xml file to 3.3.0.