Navigation

    Monaca & Onsen UI
    • Register
    • Login
    • Search
    • Tags
    • Users
    • Blog
    • Playground
    1. Home
    2. tsaihuangsd
    • Flag Profile
    • Profile
    • Following
    • Followers
    • Blocks
    • Topics
    • Posts
    • Best
    • Groups
    Save
    Saving

    tsaihuangsd

    @tsaihuangsd

    0
    Reputation
    1
    Posts
    14
    Profile views
    0
    Followers
    0
    Following
    Joined Last Online

    tsaihuangsd Follow

    Posts made by tsaihuangsd

    • navigator.camera.getPciture() returns "Not allowed to load local resource" error after success

      navigator.camera.getPicture(
      function(success){
      // success = success.replace(“file://”,"");
      console.log(“Got photo: " + success);
      $(”#inPhotoSavePath").val(success);
      $("#inPhotoSaveImg").attr(“src”, success);
      $("#inPhotoSaveImg").show();
      function(failure){
      console.log("Photo failure: " + failure);
      },
      { quality: 10,
      saveToPhotoAlbum: true,
      targetWidth: 100,
      targetHeight: 100
      }
      )
      }
      After invoking the above getPicture function, it shows the following in console.log:

      Got photo: file:///data/user/0/mobi.monaca.debugger/cache/1655003948696.jpg
      Not allowed to load local resource: file:///data/user/0/mobi.monaca.debugger/cache/1655003948696.jpg

      I also tried to remove “file://” from the “success” by uncommenting the first line in the success function. The “Not allowed to load local resource…” error disappears, but the image cannot display on screen.

      Any ideas on how I can fix this or how should I access the image saved by the getPicture function?

      posted in Developer Corner
      tsaihuangsd