Can I suggest a fix to the .js file...
Added
Code:
if(NcodeImageResizer.MAXWIDTH > 0 && this.img.width > NcodeImageResizer.MAXWIDTH) {
this.img.height = (NcodeImageResizer.MAXWIDTH / this.img.width) * this.img.height;
this.img.width = NcodeImageResizer.MAXWIDTH;
} // keep proportions if both options set
Giving....
Code:
NcodeImageResizer.prototype.scale = function() {
this.img.height = this.originalHeight;
this.img.width = this.originalWidth;
if(NcodeImageResizer.MAXWIDTH > 0 && this.img.width > NcodeImageResizer.MAXWIDTH) {
this.img.height = (NcodeImageResizer.MAXWIDTH / this.img.width) * this.img.height;
this.img.width = NcodeImageResizer.MAXWIDTH;
}
if(NcodeImageResizer.MAXHEIGHT > 0 && this.img.height > NcodeImageResizer.MAXHEIGHT) {
this.img.width = (NcodeImageResizer.MAXHEIGHT / this.img.height) * this.img.width;
this.img.height = NcodeImageResizer.MAXHEIGHT;
}
if(NcodeImageResizer.MAXWIDTH > 0 && this.img.width > NcodeImageResizer.MAXWIDTH) {
this.img.height = (NcodeImageResizer.MAXWIDTH / this.img.width) * this.img.height;
this.img.width = NcodeImageResizer.MAXWIDTH;
} // keep proportions if both options set
this.warning.width = this.img.width;
this.warning.onclick = function() { return this.resize.unScale(); }
if(this.img.width < 400) {
this.setText(vbphrase['ncode_imageresizer_warning_small']);
} else if(this.img.fileSize && this.img.fileSize > 0) {
this.setText(vbphrase['ncode_imageresizer_warning_filesize'].replace('%1$s', this.originalWidth).replace('%2$s', this.originalHeight).replace('%3$s', Math.round(this.img.fileSize/1024)));
} else {
this.setText(vbphrase['ncode_imageresizer_warning_no_filesize'].replace('%1$s', this.originalWidth).replace('%2$s', this.originalHeight));
}
return false;
}