Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-15746] Android : Blob which returned by toImage Method has undefined mimeType (parity issue)

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2013-12-10T20:33:20.000+0000
Affected Version/sRelease 3.1.3
Fix Version/s2013 Sprint 25 API, Release 3.3.0
ComponentsAndroid
LabelsSupportTeam, module_media, qe-testadded
ReporterJong Eun Lee
AssigneeSunila
Created2013-11-14T02:03:34.000+0000
Updated2014-08-14T20:35:34.000+0000

Description

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}

Comments

  1. Sunila 2013-11-20

    Added mimetype to the krollDict that is returned https://github.com/appcelerator/titanium_mobile/pull/4999
  2. Priya Agarwal 2014-04-18

    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.
  3. Kwab Fordjour 2014-08-06

    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
  4. Kwab Fordjour 2014-08-14

    Never mind. I just had to change the Titanium SDK in my tiapp.xml file to 3.3.0.

JSON Source