Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-25281] Windows: Ti.Media.saveToPhotoGallery does not accept a blob

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2017-11-17T16:53:38.000+0000
Affected Version/sRelease 7.0.0, Release 6.2.0
Fix Version/sRelease 7.0.0
ComponentsWindows
Labelsparity
ReporterEwan Harris
AssigneeGary Mathews
Created2017-09-14T15:31:46.000+0000
Updated2018-08-06T17:49:37.000+0000

Description

Description

Calling Ti.Media.saveToPhotoGallery with a blob crashes an application, when running normally the app crashes with no error. Running in debug from VS shows that the error is occurring [here](https://github.com/appcelerator/titanium_mobile_windows/blob/91c53831aa37f46cda9ec9d0140d444fced41a3e/Source/Media/src/Media.cpp#L378) as media is empty
var win = Ti.UI.createWindow();

var view = Ti.UI.createView({
    backgroundColor: 'red',
    width: 400,
    height: 400,
    borderRadius: 200
});


win.add(view);
win.open();

view.toImage(function(image) {
    console.log('image done');
    console.log(image.length)
    Ti.Media.saveToPhotoGallery(image, {
        success: function(e) {
            console.log('success');
        },
        error: function(e) {
            console.log(' error');
        }
    });
});

Steps to reproduce

Add to an existing app.js and build for Windows

Actual

App crashes

Expected

App shouldn't crash, red circle should be written to gallery

Comments

  1. Gary Mathews 2017-10-04

    master: https://github.com/appcelerator/titanium_mobile_windows/pull/1133
  2. Eric Merriman 2018-08-06

    Cleaning up older fixed issues. If this issue should not have been closed as fixed, please reopen.

JSON Source