Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-3190] iOS: Encoding base64 images not working

GitHub Issuen/a
TypeNew Feature
PriorityLow
StatusClosed
ResolutionFixed
Resolution Date2011-08-05T14:24:53.000+0000
Affected Version/sn/a
Fix Version/sSprint 2011-31, Release 1.8.0
ComponentsiOS
Labelsklist, module_utils, qe-testadded
ReporterPedro Enrique
AssigneeBlain Hamon
Created2011-04-15T03:39:06.000+0000
Updated2012-08-28T03:15:39.000+0000

Description

There is a HD ticket asking for the Base64 feature to work on images as a blob, which do not work now. There is an Obj-C suggested code that I have tested and works: http://www.pastie.org/1590281">http://www.pastie.org/1590281 (UtilsModule.m)

The JS example is:

var f = Ti.Filesystem.getFile(Ti.Filesystem.resourcesDirectory,'KS_nav_phone.png');
var blob = f.read();
var encoded = Ti.Utils.base64encode(blob);

Ti.API.info(encoded);

HD Ticket: http://developer.appcelerator.com/helpdesk/view/74871">http://developer.appcelerator.com/helpdesk/view/74871
Tested on Ti SDK 1.6.0 RC1
iPhone Simulator 4.2

Comments

  1. James David Low 2011-04-15

    I have a patch for this here:
    https://appcelerator.lighthouseapp.com/projects/32238/tickets/1611-ios-base64-encodingdecoding-of-blob-cannot-be-round-tripped-successfully"> https://appcelerator.lighthouseapp.com/projects/32238/tickets/1611-...

    But can someone please patch the Titanium mobile SDK so that I don't have to keep updating every time a new SDK is realease?

    Thanks :)

  2. Reggie Seagraves 2011-08-01

    Should be using stream support instead of f.read()
  3. Kincy Clark 2011-08-01

    Updated to IMMEDIATE. Currently blocking a customer project
  4. Aaron K. Saunders 2011-08-28

    so, since this is fixed? How do i get it? do I need to move to the nightly builds?
  5. Kevin Whinnery 2011-08-28

    Ti.Util.base64encode seems not to be working in iOS at all in 1.7.2 - it breaks when used for plain text for HTTP Basic auth as well.
  6. Dereck 2011-11-02

    This still does not seem to be working in 1.7.5, it's making it impossible to finish a project I'm working on
  7. Shyam Bhadauria 2012-08-28

    Environment used for verification - Tested with Titanium SDK: 2.2.0.v20120827143312,1.8.2 Tested with Titanium  Studio: 2.1.2.201208201549 Device - iOS 5.1 Machine OS - MAC 10.7.3

JSON Source