Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-14660] MobileWeb: Using base64 image data as source for ImageView does not work

GitHub Issuen/a
TypeBug
PriorityLow
StatusClosed
ResolutionWon't Fix
Resolution Date2017-06-26T22:22:03.000+0000
Affected Version/sRelease 3.1.1
Fix Version/sn/a
ComponentsMobileWeb
Labelsbase64, imageview, mobileweb
ReporterMorten F. Thomsen
AssigneeChris Barber
Created2013-07-10T06:46:20.000+0000
Updated2018-04-04T23:20:16.000+0000

Description

*Problem* Using setImage on an ImageView with base64 data on Mobile Web does not work - it seems like it is treated as a filename, and an error is thrown - the error indicating it is trying to access a file named as the base64 data (see screenshot). It does not recognize it as base64 data. *Test case*
var oxi = {};

var win = Ti.UI.createWindow({
	backgroundColor : "#FFF"
});

var view = Ti.UI.createView({
	opacity : 1,
	backgroundColor : 'white'
});
win.add(view);
win.open();

var base64 = 'iVBORw0KGgoAAAANSUhEUgAAAbgAAAEsCAYAAACxPabmAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAE6FJREFUGBntwQ2QXWdhmOH3fPfsyvpZ/ViWLKPYstj1go0dSOMYMNjec7KmNgGmuMmUaTLTBjqdkhSXNgkJdhh+7DSkJbQh/ARoTNMECJ20DZlkHIO5R7UNxg0hBBfSyBI2McFGsi1LsqTV7t57Ko+8Y3klrffePVd77nff5wFJkiRJkiRJkiRJkiRJkiRJkiRJkiRJkiRJkiRJkiRJkiRJkiRJkiRJkiRJekaC+l6W5RcDPwO8DhgHjiJJ8VsBPAD8IXBbUTQf5QQJ6mtZlr8LeA8QkKTBdRB4Z1E0P8IzGqhvZVn+CeAXgQRJGmwrgNdu37595KGHHvwCxzRQX8qy/Cbgl5AknejK7du3P/bQQw/+RYL6TpbllwJfA1YgSZpvD3B5QP3oZ4EVSJJOZTPwTxPUV7IsXwP8X2AbkqTT+WZA/WYzsAVJ0kK2BdRvfghYgSRpQQH1mxJJ0vMKqN+0kSQ9r4AkSREKS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ZJleQC2oiptQQMjpTq7gdcWRXMnx92eZfnvArcDV6C6OgtooDq6ANiCqnRBluUbi6L5OIpeoDq/WBTNnZygKJpPADej5XR1luU/wuldherqIuAcVKVtwEVoIKRUYw/wdU5tB/C3wIvQcrkly/I3FEWzzQmyLH8pcBOqjSzLNwM/BrwM+EeoF34ry/LPA98A/qIomntRlFKqsRpYw6mtAc5ieTTQ034CuDvL8puArwMrgTcCvw5sQMsmy/LNwMuAa4BXAZcAm1AvXQFcwXF7syz/FnAPcBfwjaJo7kVRSKnGamAS+DYnez2wjWqkdOYwmnMlsAP4AbAKGEFzUiBwBmRZvgn4MeBy4Erg5cB6tFw2ARPABMfty7L8PuArwNeArxVFcy/qSynV+WCW5fuLovl7PCPL8muBD1GNWWAfnXkIzXcumm8KmKVHsix/IfAW4CrgxcAmVFcbgOuA6zhuT5blfws0gY8URXMv6hspsBv4ByxdA/ivWZb/DHAfcAnwOmCIauwFvkFnHgP2ApuQTu+eomjuo3euB25C/WgzsBm4CmgCe1HfCMAHqdYkcDPwRmCI6nyyKJr76UBRNL8P/CbSwm6jt9ooBm3UV0JRND8NfIx6+zzwPrpQFM3fAP4b0qn9SlE076G3GigGCeorKccURfPnsiy/C7gJGANmgJLlkwBDwN8BHwBuK4pmmy4VRfOfZVl+L3AjcCEwA5RoEAVgCLgbuLUomnfRe4eBFjAFzKJ+swI4CswgSZIkSZIkSZIkSZIkSZIkSZIkSZIkSZIkSZIkSZIkSZIkSZIkSZIkSZIkSepP/x9E8vRBcMzDLQAAAABJRU5ErkJggg==';
var img = Ti.UI.createImageView();
img.setImage(base64);
win.add(img);

Attachments

FileDateSize
imageview_base64_mobileweb.png2013-07-10T06:46:20.000+000042420

Comments

  1. Daniel Sefton 2013-07-11

    Just curious: Does an image show up for you on iOS or Android? It's blank for me. I do get a big red "unknown error" on MobileWeb however; Bugzilla says:
    TypeError: setting a property that has only a getter
       [Break On This Error] 	
       
       src.hasOwnProperty(p) && (dest[p] = src[p]);
  2. Lee Morris 2017-06-26

    Resolving as "Won't Fix" as MobileWeb has been deprecated.
  3. Eric Merriman 2018-04-04

    Closing as will not fix.

JSON Source