FineUploader drawThumbnail error

随声附和 提交于 2019-12-23 03:53:07

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!