IBM Support

PI37339: WL6.3 CORDOVA CAMERA API FOR LARGE IMAGECAUSING CRASH WITH SPECIFIC ANDROID DEVICE

Subscribe

You can track all active APARs for this component.

 

APAR status

  • Closed as program error.

Error description

  • While testing on Nexus devices, the following sample code caused
    the application to close:
    
    function capturePicture()
    {
           navigator.camera.getPicture(
           // Takes a photo using the camera or retrieves a photo
    from the device's album (image returned as the URI of an image
    file).
           // Success
           function onSuccess(imageURI) {
                   // imageURI is the URI of an image file.
                   // Typical usage:
                    var image = document.getElementById("imageId1");
                    image.src = imageURI;
           },
           // Failure
           function onError(message) {
                   // Put here error handling code
           },
           // Options (optional argument)
           {
                   quality : 50,
                   destinationType :
    navigator.camera.DestinationType.FILE_URI,
                   sourceType
    :navigator.camera.PictureSourceType.CAMERA,
                   allowEdit : true,
                   encodingType : Camera.EncodingType.JPEG,
                   targetWidth : 99, //these sizes are far too
    small, and the images are barely visible at this size.
                   targetHeight : 99, // Changing them to a
    reasonable image size causes the Android application to crash
                   popoverOptions : CameraPopoverOptions,
                   saveToPhotoAlbum : true,
                   correctOrientation : true,
                   cameraDirection : Camera.Direction.BACK
           });
    }
    
    The above code is a simple application which calls on the camera
    plugin. The application will take a picture, then since
    "allowEdit" is true, will allow the user crop the picture.
    Lastly, the cropped image is shown on the application.
    
    When setting the targetWidth and targetHeight to a large number,
    such as 2048, the application will close when the crop button is
    pressed. There is no apparent exception and the application does
    not get any warnings; the application just closes.
    
    If "allowEdit" is set to false, the picture will not be asked to
    crop and will just be shown on the application. There are no
    problems here even if the targetWidth and targetHeight is set to
    a large number.
    
    This narrows down the problem to cropping large images.
    

Local fix

Problem summary

  • ****************************************************************
    * USERS AFFECTED:                                              *
    * Nexus device users who use the Cordova camera plugin to crop *
    * large images.                                                *
    ****************************************************************
    * PROBLEM DESCRIPTION:                                         *
    * The problem is trying to crop a large image using the        *
    * Cordova camera plugin. The application will close with an    *
    * exception of exceeding the transaction binder limit. The     *
    * crop intent would return the whole bitmap image to the       *
    * activity, which would be very large, thus causing the        *
    * application to close and the exception thrown.               *
    ****************************************************************
    * RECOMMENDATION:                                              *
    * After installing the iFix, rebuild the Android application.  *
    ****************************************************************
    

Problem conclusion

  • The Cordova camera plugin was patched to correctly handle
    cropping large images.
    

Temporary fix

Comments

APAR Information

  • APAR number

    PI37339

  • Reported component name

    WL/MFPF ENTERPR

  • Reported component ID

    5725I4300

  • Reported release

    630

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt

  • Submitted date

    2015-03-18

  • Closed date

    2015-04-21

  • Last modified date

    2015-04-21

  • APAR is sysrouted FROM one or more of the following:

  • APAR is sysrouted TO one or more of the following:

Fix information

  • Fixed component name

    WL/MFPF ENTERPR

  • Fixed component ID

    5725I4300

Applicable component levels

  • R630 PSY

       UP

[{"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Product":{"code":"SSZH4A","label":"IBM Worklight"},"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"630","Line of Business":{"code":"LOB45","label":"Automation"}}]

Document Information

Modified date:
17 October 2021