moxiecode/moxie

Uncaught Exception when webm image has wrong extension.

acpmasquerade opened this issue · 0 comments

Lately, I encountered a particular situation where moxie/src/javascript/runtime/html5/image/ImageInfo.js:45 throws a ImageError.WRONG_FORMAT exception which isn't caught by the caller.

Call stack.
(anonymous function) (moxie.js?v=2.1.9:8525)
(anonymous function) (moxie.js?v=2.1.9:8526)
Env.HTML5Image.Basic.extend.getInfo (moxie.js?v=2.1.9:8831)
EventTarget.Runtime._shim.exec (moxie.js?v=2.1.9:2244)
EventTarget.Runtime.Basic.extend.shimExec (moxie.js?v=2.1.9:2414)
EventTarget.Runtime.Basic.extend.exec (moxie.js?v=2.1.9:2432)
Basic.extend.exec (moxie.js?v=2.1.9:2872)
_updateInfo (moxie.js?v=2.1.9:6032)
(anonymous function) (moxie.js?v=2.1.9:6025)
(anonymous function) (moxie.js?v=2.1.9:2017)
callNext (moxie.js?v=2.1.9:242)
inSeries (moxie.js?v=2.1.9:248)
Basic.EventTarget.Basic.extend.dispatchEvent (moxie.js?v=2.1.9:2022)
Basic.EventTarget.Basic.extend.trigger (moxie.js?v=2.1.9:2067)
Env.HTML5Image._img.onload (moxie.js?v=2.1.9:8991)

I even tried adding some try..catch expressions. However, it rather seems to be an asynchronous call.

    this.bind('Load Resize', function() {
        _updateInfo.call(this);
    }, 999);

Solution as per the recommended conventions on moxie is requested.

I would suggest the exception to be propagated so that if used by plUploader, it could be handled by the Uploader.Error handler.

new plupload.Uploader({
        init : {
            Error: function(){
                ... 

To Reproduce:
Specify resize option to the plUploader config.