本文介绍了FineUploader drawThumbnail错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用FineUploader核心,我正在尝试显示上传文件的缩略图。简而言之,我正在使用它:

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);
        }
    }
 });

但是,我在Firebug中收到以下错误:

However, I get the following error in Firebug:

ReferenceError:未定义MegaPixImage
mpImg = new MegaPixImage(fileOrBlob,megapixErrorHandler);

ReferenceError: MegaPixImage is not definedmpImg = new MegaPixImage(fileOrBlob, megapixErrorHandler);

我缺少什么?

推荐答案

好的,我看到MegaPixImage是一个包含在FineUploader版本中的外部JavaScript库,但不适用于我当前的RequireJS设置。如果我将MegaPixImage作为单独的文件包含在内,我可以使用缩略图功能

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

这篇关于FineUploader drawThumbnail错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-10 22:12