Topic: Changing resize image setting not working second time
I'm trying an option to allow the user to compress images
By default , images are compressed, and if turned off they submit at original size
However the setting does not seem to be taking affect if it is then turned back on, the settings are ignored and the file uploaded at the original file size
$("#document_uploader").pluploadQueue({
runtimes : 'html5,flash,silverlight',
url : './ajax/document_upload.php',
chunk_size : '1mb',
filters : [
{title : "Documents and Images", extensions : "docx,doc,ppt,xlsx,xls,pdf,jpg,gif,png,txt"}
],
dragdrop:true,
resize:{
width:1920,
height:1080,
quality:92},
init : {
UploadComplete: function(up, files) {
....
},
FileUploaded: function(up,file,info){
if(info.status=='200'){
var response = jQuery.parseJSON(info.response);
if(typeof(response.error)!='undefined'){
up.removeFile(file);
alert(response.error.message)
}
}
}
}
});
$('#compress_images').on('change',function(){
if($(this).prop('checked')==true){
$("#document_uploader").pluploadQueue().setOption('resize',{
width:1920,
height:1080,
quality:92});
$("#document_uploader").pluploadQueue().refresh();
}else{
$("#document_uploader").pluploadQueue().setOption('resize',{
width:6000,
height:4000,
quality:100});
$("#document_uploader").pluploadQueue().refresh();
}
})
Any suggestions?