Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-20563] Base64encode doesn't work

GitHub Issuen/a
TypeBug
Priorityn/a
StatusOpen
ResolutionUnresolved
Affected Version/sRelease 5.2.0
Fix Version/sn/a
Componentsn/a
LabelsCamera, iOS
ReporterArildo Junior
AssigneeUnknown
Created2016-02-24T21:46:05.000+0000
Updated2018-02-28T19:55:27.000+0000

Description

Just take a picture and try to base64encode the media result. In console I have this logs after waiting about 2 minutes to process the base64encode:
Snapshotting a view that has not been rendered results in an empty snapshot. Ensure your view has been rendered at least once before snapshotting or snapshot after screen updates.
[INFO] :   Communications error: <OS_xpc_error: <error: 0x39e8f654> { count = 1, contents =
[INFO] :   	"XPCErrorDescription" => <string: 0x39e8f854> { length = 22, contents = "Connection interrupted" }
[INFO] :   }>
[INFO] :   Received memory warning.
[INFO] :   Received memory warning.
[INFO] :   LaunchServices: disconnect event received for service com.apple.lsd.mapdb
[INFO] :   Received memory warning.
[INFO] :   *** ASL MESSAGE SIZE (13857279 bytes) EXCEEDED MAXIMIMUM SIZE (2048000 bytes) ***
Example below:
		Titanium.Media.showCamera({		
			success:function(event) {
                                Ti.Utils.base64encode(event.media);
                                // AFTER 2 MINUTES YOU WILL SEE THOSE MESSAGES ABOVE
			},
			cancel:function() {
		
			},
			error:function(error) {
				// create alert
				var a = Titanium.UI.createAlertDialog({title:'Camera'});
		
				// set message
				if (error.code == Titanium.Media.NO_CAMERA) {
					a.setMessage('Device does not have video recording capabilities');
				} else {
					a.setMessage('Unexpected error: ' + error.code);
				}
		
				// show alert
				a.show();
			},
			allowEditing:true
		});

Attachments

FileDateSize
log.log2016-02-24T21:39:39.000+00005169182

Comments

  1. Fokke Zandbergen 2016-02-26

    Related Stack Overflow question: http://stackoverflow.com/questions/35233932/unable-to-make-an-image-blob-json-serializable/35381676 [~arildo] could you check with some older SDKs as well, and also 5.2.0?
  2. Arildo Junior 2016-02-29

    Also didn't work unfortunately.
  3. Nazmus Salahin 2016-03-10

    I am not able to reproduce this issue. The following code line gives a log message but the camera app is not stuck.
       Ti.Utils.base64encode(event.media);
       
    The only error log that I get is :
       [INFO] :   Choreographer: Skipped 52 frames!  The application may be doing too much work on its main thread.
       
    *Environment*: *Device info:* Nexux7 (android 6.0.1) *Node.js Version:* 0.12.7 *npm Version:* 2.11.3 *Titanium SDKs:* 5.2.0 and 5.1.2.GA *Java Development Kit Version:* 1.8.0_73 *Titanium CLI Version:* 5.0.5
  4. Arildo Junior 2016-03-14

    In my case the camera app is not able to generate a base64 string from event.media Blob. Were you be able to generate this base64string? Did you print out on your console Nazmus? I didn't test on Android devices but I will in the future. This issue must be fixed on both platforms.

JSON Source