1

our app crashes randomly while taking photos when the method get picture is called.

We do have background URL to the element on whose click we launch the camera...

But we cannot remove this URL. tried all the options but nothing works app still crashes please help.

our app crashes randomly while taking photos when the method get picture is called.

We do have background URL to the element on whose click we launch the camera...

But we cannot remove this URL. tried all the options but nothing works app still crashes please help.

HTML markup:

<div class="ui-grid-a"> <img class = "ui-block-a ui-bar-a new-photo-class accident-photos-block accident-photos-block-margin-right accident-photos-img owner-information-photos-class" id="ownerInformation_photo1" data-photoname = "photo1" /> <img class = "ui-block-b ui-bar-a new-photo-class accident-photos-block accident-photos-block-margin-left accident-photos-img owner-information-photos-class" id="ownerInformation_photo2" data-photoname = "photo2"/> </div>

class: 

.new-photo-class{
    background-repeat:no-repeat;
    background-position: center; 
    background-image: url('images/hdpi/new_photo.png'); 
    background-image: url('images/hdpi/new_photo.png'), -webkit-gradient(linear, left top, left bottom, from(#636363), to(#3f3f3f)); /* Saf4+, Chrome */
    background-image: url('images/hdpi/new_photo.png'), -webkit-linear-gradient(top, #636363, #3f3f3f); /* Chrome 10+, Saf5.1+ */
    background-image: url('images/hdpi/new_photo.png'),    -moz-linear-gradient(top, #636363, #3f3f3f); /* FF3.6+ */
    background-image: url('images/hdpi/new_photo.png'),     -ms-linear-gradient(top, #636363, #3f3f3f); /* IE10 */
    background-image: url('images/hdpi/new_photo.png'),      -o-linear-gradient(top, #636363, #3f3f3f); /* Opera 11.10+ */
    background-image: url('images/hdpi/new_photo.png'),         linear-gradient(top, #636363, #3f3f3f);

}

.new-photo-class:hover{
    background-repeat:no-repeat;
    background-position: center; 
    background-image: url('images/hdpi/new_photo.png'); 
    background-image: url('images/hdpi/new_photo.png'), -webkit-gradient(linear, left top, left bottom, from( #ffae00 /*{d-bdown-background-start}*/), to( #febe10 /*{d-bdown-background-end}*/)) !important; /* Saf4 , Chrome */
    background-image: url('images/hdpi/new_photo.png'), -webkit-linear-gradient( #ffae00 /*{d-bdown-background-start}*/, #febe10 /*{d-bdown-background-end}*/) !important; /* Chrome 10 , Saf5.1  */
    background-image: url('images/hdpi/new_photo.png'),   -moz-linear-gradient( #ffae00 /*{d-bdown-background-start}*/, #febe10 /*{d-bdown-background-end}*/) !important; /* FF3.6 */
    background-image: url('images/hdpi/new_photo.png'),    -ms-linear-gradient( #ffae00 /*{d-bdown-background-start}*/, #febe10 /*{d-bdown-background-end}*/) !important; /* IE10 */
    background-image: url('images/hdpi/new_photo.png'),     -o-linear-gradient( #ffae00 /*{d-bdown-background-start}*/, #febe10 /*{d-bdown-background-end}*/) !important; /* Opera 11.10  */
    background-image: url('images/hdpi/new_photo.png'),        linear-gradient( #ffae00 /*{d-bdown-background-start}*/, #febe10 /*{d-bdown-background-end}*/)!important;
}

and the click of the photo image:
 // click function of photo 
    $(".owner-information-photos-class").off('click').on('click', function(){
        var photoNumber = $(this).data(Constants.photo_name);
        var photoId = $(this).attr(Constants.id);
        var src = $(this).attr(Constants.src);
        if(src === Config.add_image_url){
            DeviceManager.capturePhoto(photoNumber, photoId, Constants.owner_information_directory_key, false);
        } else {

            photoNameOwnerInfo = photoNumber;
            // set the source path of the image to the global variable
            largeImageSrc = src;
            // make a change page with the larger image shown 
            $.mobile.changePage( "#pageAccidentPhotosLargeImage");
        }
    });

------------------------------------------------------------------------
Sheetal
  • 1,368
  • 1
  • 9
  • 15

1 Answers1

0

Capturing and storing a picture taken with the Camera into a local database / PhoneGap / Cordova / iOS

Here is another example: https://gist.github.com/dhavaln/2238017

Community
  • 1
  • 1
vasanth
  • 715
  • 10
  • 23
  • In my code, there is a box with image and on click of that box i capture image and replace the image taken. There is problem when there is a css with background image, on the control that launches camera, here in my case the box, if i remove the class new-photo-class, then all works fine in iOS. – Sheetal Jul 16 '13 at 09:34