You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by "Gergely Dimitrievits (JIRA)" <ji...@apache.org> on 2017/11/23 10:16:00 UTC

[jira] [Updated] (CB-13603) Android - navigator.camera.getPicture hangs with downloaded image

     [ https://issues.apache.org/jira/browse/CB-13603?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Gergely Dimitrievits updated CB-13603:
--------------------------------------
    Description: 
I have the following code:

{code:javascript}
$('#btnBrowsePicture').on('click', function () {
    console.log("Browsing picture.");
    try {
        navigator.camera.getPicture(
            function (fileUri) {
                try {
                    console.log("Picture selection is success. File: " + fileUri);

                    _this._upload.AllInOneUploadPicture(_this._psId, fileUri, function () {
                    });
                }
                catch (e) {
                    console.error(e.message);
                }
            },
            function (error) {
                console.error("Picture selection error. Error: " + error);
                },
            {
                destinationType: Camera.DestinationType.FILE_URI,
                mediaType: Camera.MediaType.PICTURE,
                sourceType: Camera.PictureSourceType.PHOTOLIBRARY
            });
    }
    catch (e) {
        console.error(e.message);
    }
});       
{code}

When I click the button, I can see the "Browsing picture" in the Visual Studio 2017 Javascript debug console and the gallery opens. When I try to browse a picture from gallery (jpg) it is ok, but when I try a downloaded gif The application hangs with Android message: the application is shut down. Reopen the application!

No other error message or log in the console after that in Android 8.0.0.
In previous version I see the error message:
"Picture selection error. Error: Selection cancelled." so this is the:
{code:javascript}
function (error) {
  console.error("Picture selection error. Error: " + error);
},
{code}

This is the same when I use this settings with video:
{code:javascipt}
{
    destinationType: Camera.DestinationType.FILE_URI,
    mediaType: Camera.MediaType.VIDEO,
    sourceType: Camera.PictureSourceType.PHOTOLIBRARY
});
{code}
With mp4 everything works fine, but when I try to open a downloaded mov, the error occures.

I have tested it:
- Android 6.0.1 (Samsung Galaxy S5) ({color:#8eb021}Works well{color})
- Android 7.0 (Sony XPeria XA) ({color:#8eb021}Works well{color})
- Android 8.0.0 (Google Nexus 5x) ({color:#d04437}*Error*{color})

Thanks in advance!

  was:
I have the following code:

{code:javascipt}
$('#btnBrowsePicture').on('click', function () {
    console.log("Browsing picture.");
    try {
        navigator.camera.getPicture(
            function (fileUri) {
                try {
                    console.log("Picture selection is success. File: " + fileUri);

                    _this._upload.AllInOneUploadPicture(_this._psId, fileUri, function () {
                    });
                }
                catch (e) {
                    console.error(e.message);
                }
            },
            function (error) {
                console.error("Picture selection error. Error: " + error);
                },
            {
                destinationType: Camera.DestinationType.FILE_URI,
                mediaType: Camera.MediaType.PICTURE,
                sourceType: Camera.PictureSourceType.PHOTOLIBRARY
            });
    }
    catch (e) {
        console.error(e.message);
    }
});       
{code}

When I click the button, I can see the "Browsing picture" in the Visual Studio 2017 Javascript debug console and the gallery opens. When I try to browse a picture from gallery (jpg) it is ok, but when I try a downloaded gif The application hangs with Android message: the application is shut down. Reopen the application!

No other error message or log in the console after that in Android 8.0.0.
In previous version I see the error message:
"Picture selection error. Error: Selection cancelled." so this is the:
{code:javascript}
function (error) {
  console.error("Picture selection error. Error: " + error);
},
{code}

This is the same when I use this settings with video:
{code:javascipt}
{
    destinationType: Camera.DestinationType.FILE_URI,
    mediaType: Camera.MediaType.VIDEO,
    sourceType: Camera.PictureSourceType.PHOTOLIBRARY
});
{code}
With mp4 everything works fine, but when I try to open a downloaded mov, the error occures.

I have tested it:
- Android 6.0.1 (Samsung Galaxy S5) ({color:#8eb021}Works well{color})
- Android 7.0 (Sony XPeria XA) ({color:#8eb021}Works well{color})
- Android 8.0.0 (Google Nexus 5x) ({color:#d04437}*Error*{color})

Thanks in advance!


> Android - navigator.camera.getPicture hangs with downloaded image
> -----------------------------------------------------------------
>
>                 Key: CB-13603
>                 URL: https://issues.apache.org/jira/browse/CB-13603
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: cordova-plugin-camera
>    Affects Versions: 6.3.1, 2.4.1
>         Environment: Android 8.0.0 - LG Nexus 5X
>            Reporter: Gergely Dimitrievits
>            Priority: Critical
>
> I have the following code:
> {code:javascript}
> $('#btnBrowsePicture').on('click', function () {
>     console.log("Browsing picture.");
>     try {
>         navigator.camera.getPicture(
>             function (fileUri) {
>                 try {
>                     console.log("Picture selection is success. File: " + fileUri);
>                     _this._upload.AllInOneUploadPicture(_this._psId, fileUri, function () {
>                     });
>                 }
>                 catch (e) {
>                     console.error(e.message);
>                 }
>             },
>             function (error) {
>                 console.error("Picture selection error. Error: " + error);
>                 },
>             {
>                 destinationType: Camera.DestinationType.FILE_URI,
>                 mediaType: Camera.MediaType.PICTURE,
>                 sourceType: Camera.PictureSourceType.PHOTOLIBRARY
>             });
>     }
>     catch (e) {
>         console.error(e.message);
>     }
> });       
> {code}
> When I click the button, I can see the "Browsing picture" in the Visual Studio 2017 Javascript debug console and the gallery opens. When I try to browse a picture from gallery (jpg) it is ok, but when I try a downloaded gif The application hangs with Android message: the application is shut down. Reopen the application!
> No other error message or log in the console after that in Android 8.0.0.
> In previous version I see the error message:
> "Picture selection error. Error: Selection cancelled." so this is the:
> {code:javascript}
> function (error) {
>   console.error("Picture selection error. Error: " + error);
> },
> {code}
> This is the same when I use this settings with video:
> {code:javascipt}
> {
>     destinationType: Camera.DestinationType.FILE_URI,
>     mediaType: Camera.MediaType.VIDEO,
>     sourceType: Camera.PictureSourceType.PHOTOLIBRARY
> });
> {code}
> With mp4 everything works fine, but when I try to open a downloaded mov, the error occures.
> I have tested it:
> - Android 6.0.1 (Samsung Galaxy S5) ({color:#8eb021}Works well{color})
> - Android 7.0 (Sony XPeria XA) ({color:#8eb021}Works well{color})
> - Android 8.0.0 (Google Nexus 5x) ({color:#d04437}*Error*{color})
> Thanks in advance!



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org