#1 COMPRESS AN IMAGE FILE
Posted: Thu Jan 03, 2019 6:15 pm
how can we compress an IMAGE file from camera and store it store it in our DB.
Forum for Appzillon Developers
https://forum.appzillon.com//
Code: Select all
var jsonobj = {
targetWidth: "200",
targetHeight: "200",
crop: "Y",
flash: "N",
action: "base64_Save",
fileName: imageNumber.toString(),
quality: "50",
encodingType: "JPG",
sourceType: "Camera",
openNativeCamera: "Y",
fileOverwrite: "N"
};
apz.ns.openCamera(jsonobj);
Code: Select all
var jsonobj = {
"zoomLevel": "20",
"targetWidth": "200",
"targetHeight":"200",
"crop": "Y",//Y or N
"flash": "N",
"action": "base64",
"fileName": “Sample”,
"quality" : "50",
"encodingType" : "JPG",
"sourceType":"camera" // photo
};
jsonobj.id = "CAMERA_ID";
jsonobj.callBack = cameraCallback;
apz.ns.openCamera(jsonobj);
Code: Select all
cameraCallback = function(pjson){
if(pjson.status){
document.getElementById("loadImage").src = "data:image/jpg;base64," + pjson.encodedImage;
}else{
alert("Failure");
}
}