Rectangle 27 0

The whole problem was not related to my code or any of the cordova code. So why did it happen? ==> I don't exactly know that, for it seems that this bug or whatever you might call it, has occurred to many people.

And they all tried to delete or deactivate the cache as I did, some of their problems are very close to my own but most aren't, so it took a while til I found a solution.

I read this thread and tried to append a timestamp to the image path and it worked! My conclusion to this it, that there might be a problem with the UIWebView and the cache management. Or it might proof as a general WebView problem, I will be able to check that in a few days on an Adroid device.

(IOS) Cordova Camera Plugin Referring to deleted images - Stack Overfl...

ios image cordova camera
Rectangle 27 0

Cordova / PhoneGap Plugin Permission Settings for NSCameraUsageDescription, NSPhotoLibraryUsageDescription and NSMicrophoneUsageDescription in iOS by adding a declaration to the Config.xml file

<plugin name="cordova-plugin-media-capture" source="npm" spec="*">
  <variable name="CAMERA_USAGE_DESCRIPTION" value="App would like to access the camera." />
  <variable name="MICROPHONE_USAGE_DESCRIPTION" value="App would like to access the microphone." />
  <variable name="PHOTOLIBRARY_USAGE_DESCRIPTION" value="App would like to access the library." />
</plugin>

ios - Cordova / PhoneGap Plugin Permission Settings for NSCameraUsageD...

ios cordova camera phonegap-build image-gallery
Rectangle 27 0

You can use this plugin to get you the base64 encoding of the image, it uses js code for iOS, but in case of android it uses native code to handle android versions lower then v.3 because android versions lower then 3 are not handle toDataUrl functionality

cordova - Using PhoneGap, How to get base64 image data of the photo ch...

cordova camera base64 photolibrary
Rectangle 27 0

I think is a performance issue in javascript. I didn't try to crop a image natively but I have a memory problem in iOS. I catch the base64 string (DATA_URL) and I edit it with a javascript plugin. I suppose you need the base64 image too. Otherwise, FILE_URI is better.

Look at the John Wargo's answer, maybe that help you

NOTE: Photo resolution on newer devices is quite good. Photos selected from the device's gallery are not downscaled to a lower quality, even if a quality parameter is specified. To avoid common memory problems, set Camera.destinationType to FILE_URI rather than DATA_URL.

android - Cropping an image natively in phonegap with allowEdit flag -...

android cordova android-camera phonegap-plugins cordova-3
Rectangle 27 0

<!DOCTYPE html>

<html>
<head>
<meta charset="utf-8">
<meta content="telephone=no" name="format-detection">
<! WARNING: for iOS 7, remove the width=device-width and height=device-height attributes. See https://issues.apache.org/jira/browse/CB-4323 >
<meta content=
"user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width, height=device-height, target-densitydpi=device-dpi"
name="viewport">
<script src="cordova.js" type="text/javascript"></script>
<script src="js/index.js" type="text/javascript"></script>
<title>Camera Cordova Plugin</title>
</head>

<body>
<button onclick="capturePhoto();">Capture Photo</button><br>
<button onclick="getPhoto(pictureSource.PHOTOLIBRARY);">From Photo
Library</button><br>
<img id="image" src="" style="display:none;width:100%;">
<button onclick="upload();">Upload</button>
</body>
</html>
function upload() {
    var img = document.getElementById('image');
    var imageURI = img.src;
    var options = new FileUploadOptions();
    options.fileKey = "file";
    options.fileName = imageURI.substr(imageURI.lastIndexOf('/') + 1);
    options.mimeType = "image/jpeg";
    var params = new Object();
    options.params = params;
    options.chunkedMode = false;
    var ft = new FileTransfer();
    ft.upload(imageURI, "https://www.example.com/upload.php", win, fail,
        options);
}

function win(r) {
    console.log("Code = " + r.responseCode);
    console.log("Response = " + r.response);
    console.log("Sent = " + r.bytesSent);
}

function fail(error) {
    alert("An error has occurred: Code = " + error.code);
    console.log("upload error source " + error.source);
    console.log("upload error target " + error.target);
}
<?php
move_uploaded_file($_FILES["file"]["tmp_name"], '/path/to/file');

I really think it's something with the FileTransfer plugin or settings. Taking the photo is fine and it's sending the data, just not in the right MIME format

php - Uploading Picture From PhoneGap Cordova App - Stack Overflow

php android cordova mime
Rectangle 27 0

I have same problem, my image sizes must be less than 100 KB. I think you can't know the camera resolution, look cordova documentation:

quality: Quality of the saved image, expressed as a range of 0-100, where 100 is typically full resolution with no loss from file compression. (Number) (Note that information about the camera's resolution is unavailable.)

But on ios you have a copy:

When using destinationType.FILE_URI, photos are saved in the application's temporary directory. You may delete the contents of this directory using the navigator.fileMgr APIs if storage space is a concern.

I have tested several qualities but if the resolution camera is poor photos will be poor too.

cordova - What effect does quality setting have for the Phonegap camer...

ios cordova phonegap-plugins phonegap-build
Rectangle 27 0

First make sure you're using Camera and not Capture. Afterwards, when setting up your camera, make sure to set the CameraOptions. Here you can specify if you want to save the file localy or not. You do this by setting the camera option: saveToPhotoAlbum to false.Here you can check how to setup the camera.Here you can find how to setup your camera options.

javascript - Is it possible to prevent Cordova's camera plugin from st...

javascript android ios cordova camera