问题
I'm using the FineUploader core and I'm trying to show a thumbnail of the uploaded files. In a nutshell I'm using this:
this.uploader = new qq.FineUploaderBasic({
callbacks: {
onSubmit: function(id, fileName) {
var canvas = document.createElement('canvas');
canvas.width = 50;
canvas.height = 50;
$('#file-'+id+' .upload_thumbnail').html(canvas);
this.drawThumbnail(id, canvas, 50, false);
}
}
});
However, I get the following error in Firebug:
ReferenceError: MegaPixImage is not defined mpImg = new MegaPixImage(fileOrBlob, megapixErrorHandler);
What am I missing?
回答1:
Ok, I see the MegaPixImage is an external javascript library that is included in the FineUploader build, but doesn't work with my current RequireJS setup. If I include the MegaPixImage as a seperate file, I get the thumbnail function to work
来源:https://stackoverflow.com/questions/21910531/fineuploader-drawthumbnail-error