test/public/UEditorPlus/third-party/webuploader/webuploader.js

4 lines
120 KiB
JavaScript
Raw Permalink Normal View History

2025-03-30 22:09:19 +08:00
/* WebUploader 1.0.0 */!function(a,b){var c,d={},e=function(a,b){var c,d,e;if("string"==typeof a)return h(a);for(c=[],d=a.length,e=0;d>e;e++)c.push(h(a[e]));return b.apply(null,c)},f=function(a,b,c){2===arguments.length&&(c=b,b=null),e(b||[],function(){g(a,c,arguments)})},g=function(a,b,c){var f,g={exports:b};"function"==typeof b&&(c.length||(c=[e,g.exports,g]),f=b.apply(null,c),void 0!==f&&(g.exports=f)),d[a]=g.exports},h=function(b){var c=d[b]||a[b];if(!c)throw new Error("`"+b+"` is undefined");return c},i=function(a){var b,c,e,f,g,h;h=function(a){return a&&a.charAt(0).toUpperCase()+a.substr(1)};for(b in d)if(c=a,d.hasOwnProperty(b)){for(e=b.split("/"),g=h(e.pop());f=h(e.shift());)c[f]=c[f]||{},c=c[f];c[g]=d[b]}return a},j=function(c){return a.__dollar=c,i(b(a,f,e))};"object"==typeof module&&"object"==typeof module.exports?module.exports=j():"function"==typeof define&&define.amd?define(["jquery"],j):(c=a.WebUploader,a.WebUploader=j(),a.WebUploader.noConflict=function(){a.WebUploader=c})}(window,function(a,b,c){return b("dollar-third",[],function(){var b=a.require,c=a.__dollar||a.jQuery||a.Zepto||b("jquery")||b("zepto");if(!c)throw new Error("jQuery or Zepto not found!");return c}),b("dollar",["dollar-third"],function(a){return a}),b("promise-third",["dollar"],function(a){return{Deferred:a.Deferred,when:a.when,isPromise:function(a){return a&&"function"==typeof a.then}}}),b("promise",["promise-third"],function(a){return a}),b("base",["dollar","promise"],function(b,c){function d(a){return function(){return h.apply(a,arguments)}}function e(a,b){return function(){return a.apply(b,arguments)}}function f(a){var b;return Object.create?Object.create(a):(b=function(){},b.prototype=a,new b)}var g=function(){},h=Function.call;return{version:"1.0.0",$:b,Deferred:c.Deferred,isPromise:c.isPromise,when:c.when,browser:function(a){var b={},c=a.match(/WebKit\/([\d.]+)/),d=a.match(/Chrome\/([\d.]+)/)||a.match(/CriOS\/([\d.]+)/),e=a.match(/MSIE\s([\d\.]+)/)||a.match(/(?:trident)(?:.*rv:([\w.]+))?/i),f=a.match(/Firefox\/([\d.]+)/),g=a.match(/Safari\/([\d.]+)/),h=a.match(/OPR\/([\d.]+)/);return c&&(b.webkit=parseFloat(c[1])),d&&(b.chrome=parseFloat(d[1])),e&&(b.ie=parseFloat(e[1])),f&&(b.firefox=parseFloat(f[1])),g&&(b.safari=parseFloat(g[1])),h&&(b.opera=parseFloat(h[1])),b}(navigator.userAgent),os:function(a){var b={},c=a.match(/(?:Android);?[\s\/]+([\d.]+)?/),d=a.match(/(?:iPad|iPod|iPhone).*OS\s([\d_]+)/);return c&&(b.android=parseFloat(c[1])),d&&(b.ios=parseFloat(d[1].replace(/_/g,"."))),b}(navigator.userAgent),inherits:function(a,c,d){var e;return"function"==typeof c?(e=c,c=null):e=c&&c.hasOwnProperty("constructor")?c.constructor:function(){return a.apply(this,arguments)},b.extend(!0,e,a,d||{}),e.__super__=a.prototype,e.prototype=f(a.prototype),c&&b.extend(!0,e.prototype,c),e},noop:g,bindFn:e,log:function(){return a.console?e(console.log,console):g}(),nextTick:function(){return function(a){setTimeout(a,1)}}(),slice:d([].slice),guid:function(){var a=0;return function(b){for(var c=(+new Date).toString(32),d=0;5>d;d++)c+=Math.floor(65535*Math.random()).toString(32);return(b||"wu_")+c+(a++).toString(32)}}(),formatSize:function(a,b,c){var d;for(c=c||["B","K","M","G","TB"];(d=c.shift())&&a>1024;)a/=1024;return("B"===d?a:a.toFixed(b||2))+d}}}),b("mediator",["base"],function(a){function b(a,b,c,d){return f.grep(a,function(a){return!(!a||b&&a.e!==b||c&&a.cb!==c&&a.cb._cb!==c||d&&a.ctx!==d)})}function c(a,b,c){f.each((a||"").split(h),function(a,d){c(d,b)})}function d(a,b){for(var c,d=!1,e=-1,f=a.length;++e<f;)if(c=a[e],c.cb.apply(c.ctx2,b)===!1){d=!0;break}return!d}var e,f=a.$,g=[].slice,h=/\s+/;return e={on:function(a,b,d){var e,f=this;return b?(e=this._events||(this._events=[]),c(a,b,function(a,b){var c={e:a};c.cb=b,c.ctx=d,c.ctx2=d||f,c.id=e.length,e.push(c)}),this):this},once:function(a,b,d){var e=this;return b?(c(a,b,function(a,b){var c=function(){return e.off(a,c),b.apply(d||e,arguments)};c._cb=b,e.on(a,c,d)}),e):e},off:function(a,d,e){var g=this._events;return g?a||d||e?(c(a,d,function(a,c){f.each(b(g,a,c,e),function(){delete g[this.id]}
var c=new Uint8Array(50+Math.floor(1.1*a.length)),d=C.F.deflateRaw(a,c,d,b.level);return new Uint8Array(c.buffer,0,d)},C.encode=function(a,b){null==b&&(b=!1);var c=0,d=C.bin.writeUint,e=C.bin.writeUshort,f={};for(var g in a){var h=!C._noNeed(g)&&!b,i=a[g],j=C.crc.crc(i,0,i.length);f[g]={cpr:h,usize:i.length,crc:j,file:h?C.deflateRaw(i):i}}for(var g in f)c+=f[g].file.length+30+46+2*C.bin.sizeUTF8(g);c+=22;var k=new Uint8Array(c),l=0,m=[];for(var g in f){var n=f[g];m.push(l),l=C._writeHeader(k,l,g,n,0)}var o=0,p=l;for(var g in f)n=f[g],m.push(l),l=C._writeHeader(k,l,g,n,1,m[o++]);var q=l-p;return d(k,l,101010256),l+=4,e(k,l+=4,o),e(k,l+=2,o),d(k,l+=2,q),d(k,l+=4,p),l+=4,l+=2,k.buffer},C._noNeed=function(a){var b=a.split(".").pop().toLowerCase();return-1!="png,jpg,jpeg,zip".indexOf(b)},C._writeHeader=function(a,b,c,d,e,f){var g=C.bin.writeUint,h=C.bin.writeUshort,i=d.file;return g(a,b,0==e?67324752:33639248),b+=4,1==e&&(b+=2),h(a,b,20),h(a,b+=2,0),h(a,b+=2,d.cpr?8:0),g(a,b+=2,0),g(a,b+=4,d.crc),g(a,b+=4,i.length),g(a,b+=4,d.usize),h(a,b+=4,C.bin.sizeUTF8(c)),h(a,b+=2,0),b+=2,1==e&&(b+=2,b+=2,g(a,b+=6,f),b+=4),b+=C.bin.writeUTF8(a,b,c),0==e&&(a.set(i,b),b+=i.length),b},C.crc={table:function(){for(var a=new Uint32Array(256),b=0;256>b;b++){for(var c=b,d=0;8>d;d++)1&c?c=3988292384^c>>>1:c>>>=1;a[b]=c}return a}(),update:function(a,b,c,d){for(var e=0;d>e;e++)a=C.crc.table[255&(a^b[c+e])]^a>>>8;return a},crc:function(a,b,c){return 4294967295^C.crc.update(4294967295,a,b,c)}},C.adler=function(a,b,c){for(var d=1,e=0,f=b,g=b+c;g>f;){for(var h=Math.min(f+5552,g);h>f;)e+=d+=a[f++];d%=65521,e%=65521}return e<<16|d},C.bin={readUshort:function(a,b){return a[b]|a[b+1]<<8},writeUshort:function(a,b,c){a[b]=255&c,a[b+1]=255&c>>8},readUint:function(a,b){return 16777216*a[b+3]+(a[b+2]<<16|a[b+1]<<8|a[b])},writeUint:function(a,b,c){a[b]=255&c,a[b+1]=255&c>>8,a[b+2]=255&c>>16,a[b+3]=255&c>>24},readASCII:function(a,b,c){for(var d="",e=0;c>e;e++)d+=String.fromCharCode(a[b+e]);return d},writeASCII:function(a,b,c){for(var d=0;d<c.length;d++)a[b+d]=c.charCodeAt(d)},pad:function(a){return a.length<2?"0"+a:a},readUTF8:function(a,b,c){for(var d,e="",f=0;c>f;f++)e+="%"+C.bin.pad(a[b+f].toString(16));try{d=decodeURIComponent(e)}catch(g){return C.bin.readASCII(a,b,c)}return d},writeUTF8:function(a,b,c){for(var d=c.length,e=0,f=0;d>f;f++){var g=c.charCodeAt(f);if(0==(4294967168&g))a[b+e]=g,e++;else if(0==(4294965248&g))a[b+e]=192|g>>6,a[b+e+1]=128|63&g>>0,e+=2;else if(0==(4294901760&g))a[b+e]=224|g>>12,a[b+e+1]=128|63&g>>6,a[b+e+2]=128|63&g>>0,e+=3;else{if(0!=(4292870144&g))throw"e";a[b+e]=240|g>>18,a[b+e+1]=128|63&g>>12,a[b+e+2]=128|63&g>>6,a[b+e+3]=128|63&g>>0,e+=4}}return e},sizeUTF8:function(a){for(var b=a.length,c=0,d=0;b>d;d++){var e=a.charCodeAt(d);if(0==(4294967168&e))c++;else if(0==(4294965248&e))c+=2;else if(0==(4294901760&e))c+=3;else{if(0!=(4292870144&e))throw"e";c+=4}}return c}},C.F={},C.F.deflateRaw=function(a,b,c,d){var e=[[0,0,0,0,0],[4,4,8,4,0],[4,5,16,8,0],[4,6,16,16,0],[4,10,16,32,0],[8,16,32,32,0],[8,16,128,128,0],[8,32,128,256,0],[32,128,258,1024,1],[32,258,258,4096,1]][d],f=C.F.U,g=C.F._goodIndex;C.F._hash;var h=C.F._putsE,i=0,j=c<<3,k=0,l=a.length;if(0==d){for(;l>i;)h(b,j,i+(x=Math.min(65535,l-i))==l?1:0),j=C.F._copyExact(a,i,x,b,j+8),i+=x;return j>>>3}var m=f.lits,n=f.strt,o=f.prev,p=0,q=0,r=0,s=0,t=0,u=0;for(l>2&&(n[u=C.F._hash(a,0)]=0),i=0;l>i;i++){if(t=u,l-2>i+1){u=C.F._hash(a,i+1);var v=32767&i+1;o[v]=n[u],n[u]=v}if(i>=k){(p>14e3||q>26697)&&l-i>100&&(i>k&&(m[p]=i-k,p+=2,k=i),j=C.F._writeBlock(i==l-1||k==l?1:0,m,p,s,a,r,i-r,b,j),p=q=s=0,r=i);var w=0;l-2>i&&(w=C.F._bestMatch(a,i,o,t,Math.min(e[2],l-i),e[3]));var x=w>>>16,y=65535&w;if(0!=w){y=65535&w;var z=g(x=w>>>16,f.of0);f.lhst[257+z]++;var A=g(y,f.df0);f.dhst[A]++,s+=f.exb[z]+f.dxb[A],m[p]=x<<23|i-k,m[p+1]=y<<16|z<<8|A,p+=2,k=i+x}else f.lhst[a[i]]++;q++}}for(r==i&&0!=a.length||(i>k&&(m[p]=i-k,p+=2,k=i),j=C.F._writeBlock(1,m,p,s,a,r,i-r,b,j),p=0,q=0,p=q=s=0,r=i);0!=(7&j);)j++;return j>>>3},C.F._bestMatch=function(a,b,c,d,e,f){var g=32767&b,h=c[g],i=32767&g-h+32768;if(h==g||d!=C.F.
var Y=L*P;for(w=0;Y>w;w++){var Z=3*w,$=4*w;T[Z]=Q[$],T[Z+1]=Q[$+1],T[Z+2]=Q[$+2]}Q=T,p=2,S=3,R=3*L}J.img=Q,J.bpl=R,J.bpp=S}return{ctype:p,depth:q,plte:A,frames:y}}function h(a,b,c,d,e,f,g){for(var h=Uint8Array,j=Uint32Array,k=new h(a[e-1]),l=new j(a[e-1]),m=e+1<a.length?new h(a[e+1]):null,n=new h(a[e]),o=new j(n.buffer),p=b,q=c,r=-1,s=-1,u=0;u<f.height;u++)for(var v=0;v<f.width;v++){var w=f.x+v,x=f.y+u,y=x*b+w,z=o[y];0==z||0==d[e-1].dispose&&l[y]==z&&(null==m||0!=m[4*y+3])||(p>w&&(p=w),w>r&&(r=w),q>x&&(q=x),x>s&&(s=x))}-1==r&&(p=q=r=s=0),g&&(1==(1&p)&&p--,1==(1&q)&&q--),f={x:p,y:q,width:r-p+1,height:s-q+1};var A=d[e];A.rect=f,A.blend=1,A.img=new Uint8Array(4*f.width*f.height),0==d[e-1].dispose?(t(k,b,c,A.img,f.width,f.height,-f.x,-f.y,0),i(n,b,c,A.img,f)):t(n,b,c,A.img,f.width,f.height,-f.x,-f.y,0)}function i(a,b,c,d,e){t(a,b,c,d,e.width,e.height,-e.x,-e.y,2)}function j(a,b,c,d,e,f,g){var h,i=[],j=[0,1,2,3,4];-1!=f?j=[f]:(b*d>5e5||1==c)&&(j=[0]),g&&(h={level:0});for(var l=H,m=0;m<j.length;m++){for(var n=0;b>n;n++)k(e,a,n,d,c,j[m]);i.push(l.deflate(e,h))}var o,p=1e9;for(m=0;m<i.length;m++)i[m].length<p&&(o=m,p=i[m].length);return i[o]}function k(a,b,c,d,e,f){var g=c*d,h=g+c;if(a[h]=f,h++,0==f)if(500>d)for(var i=0;d>i;i++)a[h+i]=b[g+i];else a.set(new Uint8Array(b.buffer,g,d),h);else if(1==f){for(i=0;e>i;i++)a[h+i]=b[g+i];for(i=e;d>i;i++)a[h+i]=255&b[g+i]-b[g+i-e]+256}else if(0==c){for(i=0;e>i;i++)a[h+i]=b[g+i];if(2==f)for(i=e;d>i;i++)a[h+i]=b[g+i];if(3==f)for(i=e;d>i;i++)a[h+i]=255&b[g+i]-(b[g+i-e]>>1)+256;if(4==f)for(i=e;d>i;i++)a[h+i]=255&b[g+i]-v(b[g+i-e],0,0)+256}else{if(2==f)for(i=0;d>i;i++)a[h+i]=255&b[g+i]+256-b[g+i-d];if(3==f){for(i=0;e>i;i++)a[h+i]=255&b[g+i]+256-(b[g+i-d]>>1);for(i=e;d>i;i++)a[h+i]=255&b[g+i]+256-(b[g+i-d]+b[g+i-e]>>1)}if(4==f){for(i=0;e>i;i++)a[h+i]=255&b[g+i]+256-v(0,b[g+i-d],0);for(i=e;d>i;i++)a[h+i]=255&b[g+i]+256-v(b[g+i-e],b[g+i-d],b[g+i-e-d])}}}function l(a,b){var c,d=new Uint8Array(a),e=d.slice(0),f=new Uint32Array(e.buffer),g=m(e,b),h=g[0],i=g[1],j=d.length,k=new Uint8Array(j>>2);if(d.length<2e7)for(var l=0;j>l;l+=4)c=n(h,p=d[l]*(1/255),q=d[l+1]*(1/255),r=d[l+2]*(1/255),s=d[l+3]*(1/255)),k[l>>2]=c.ind,f[l>>2]=c.est.rgba;else for(l=0;j>l;l+=4){var p=d[l]*(1/255),q=d[l+1]*(1/255),r=d[l+2]*(1/255),s=d[l+3]*(1/255);for(c=h;c.left;)c=0>=o(c.est,p,q,r,s)?c.left:c.right;k[l>>2]=c.ind,f[l>>2]=c.est.rgba}return{abuf:e.buffer,inds:k,plte:i}}function m(a,b,c){null==c&&(c=1e-4);var d=new Uint32Array(a.buffer),e={i0:0,i1:a.length,bst:null,est:null,tdst:0,left:null,right:null};e.bst=r(a,e.i0,e.i1),e.est=s(e.bst);for(var f=[e];f.length<b;){for(var g=0,h=0,i=0;i<f.length;i++)f[i].est.L>g&&(g=f[i].est.L,h=i);if(c>g)break;var j=f[h],k=p(a,d,j.i0,j.i1,j.est.e,j.est.eMq255);if(j.i0>=k||j.i1<=k)j.est.L=0;else{var l={i0:j.i0,i1:k,bst:null,est:null,tdst:0,left:null,right:null};l.bst=r(a,l.i0,l.i1),l.est=s(l.bst);var m={i0:k,i1:j.i1,bst:null,est:null,tdst:0,left:null,right:null};for(i=0,m.bst={R:[],m:[],N:j.bst.N-l.bst.N};16>i;i++)m.bst.R[i]=j.bst.R[i]-l.bst.R[i];for(i=0;4>i;i++)m.bst.m[i]=j.bst.m[i]-l.bst.m[i];m.est=s(m.bst),j.left=l,j.right=m,f[h]=l,f.push(m)}}for(f.sort(function(a,b){return b.bst.N-a.bst.N}),i=0;i<f.length;i++)f[i].ind=i;return[e,f]}function n(a,b,c,d,e){if(null==a.left){var f,g,h,i,j,k,l,m,p;return a.tdst=(f=a.est.q,g=b,h=c,i=d,j=e,k=g-f[0],l=h-f[1],m=i-f[2],k*k+l*l+m*m+(p=j-f[3])*p),a}var q=o(a.est,b,c,d,e),r=a.left,s=a.right;q>0&&(r=a.right,s=a.left);var t=n(r,b,c,d,e);if(t.tdst<=q*q)return t;var u=n(s,b,c,d,e);return u.tdst<t.tdst?u:t}function o(a,b,c,d,e){var f=a.e;return f[0]*b+f[1]*c+f[2]*d+f[3]*e-a.eMq}function p(a,b,c,d,e,f){for(d-=4;d>c;){for(;q(a,c,e)<=f;)c+=4;for(;q(a,d,e)>f;)d-=4;if(c>=d)break;var g=b[c>>2];b[c>>2]=b[d>>2],b[d>>2]=g,c+=4,d-=4}for(;q(a,c,e)>f;)c-=4;return c+4}function q(a,b,c){return a[b]*c[0]+a[b+1]*c[1]+a[b+2]*c[2]+a[b+3]*c[3]}function r(a,b,c){for(var d=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],e=[0,0,0,0],f=b;c>f;f+=4){var g=a[f]*(1/255),h=a[f+1]*(1/255),i=a[f+2]*(1/255),j=a[f+3]*(1/255);e[0]+=g,e[1]+=h,e[2]+=i,e[3]+=j,d[0]+=g*g,d[1]+=g*h,d[2]+=g*i,d[3]+=g*j,d[5]+=h
l.attr("accept",a.join(","))}g.append(l),g.append(k),e=function(a){i.trigger(a.type)},f=function(a){var b;return 0===a.target.files.length?!1:(h.files=a.target.files,b=this.cloneNode(!0),b.value=null,this.parentNode.replaceChild(b,this),l.off(),l=c(b).on("change",f).on("mouseenter mouseleave",e),i.trigger("change"),void 0)},l.on("change",f),k.on("mouseenter mouseleave",e)},getFiles:function(){return this.files},destroy:function(){this.input.off(),this.label.off()}})}),b("runtime/html5/util",["base"],function(b){var c=a.createObjectURL&&a||a.URL&&URL.revokeObjectURL&&URL||a.webkitURL,d=b.noop,e=d;return c&&(d=function(){return c.createObjectURL.apply(c,arguments)},e=function(){return c.revokeObjectURL.apply(c,arguments)}),{createObjectURL:d,revokeObjectURL:e,dataURL2Blob:function(a){var b,c,d,e,f,g;for(g=a.split(","),b=~g[0].indexOf("base64")?atob(g[1]):decodeURIComponent(g[1]),d=new ArrayBuffer(b.length),c=new Uint8Array(d),e=0;e<b.length;e++)c[e]=b.charCodeAt(e);return f=g[0].split(":")[1].split(";")[0],this.arrayBufferToBlob(d,f)},dataURL2ArrayBuffer:function(a){var b,c,d,e;for(e=a.split(","),b=~e[0].indexOf("base64")?atob(e[1]):decodeURIComponent(e[1]),c=new Uint8Array(b.length),d=0;d<b.length;d++)c[d]=b.charCodeAt(d);return c.buffer},arrayBufferToBlob:function(b,c){var d,e=a.BlobBuilder||a.WebKitBlobBuilder;return e?(d=new e,d.append(b),d.getBlob(c)):new Blob([b],c?{type:c}:{})},canvasToDataUrl:function(a,b,c){return a.toDataURL(b,c/100)},parseMeta:function(a,b){b(!1,{})},updateImageHead:function(a){return a}}}),b("runtime/html5/imagemeta",["runtime/html5/util"],function(a){var b;return b={parsers:{65505:[]},maxMetaDataSize:262144,parse:function(a,b){var c=this,d=new FileReader;d.onload=function(){b(!1,c._parse(this.result)),d=d.onload=d.onerror=null},d.onerror=function(a){b(a.message),d=d.onload=d.onerror=null},a=a.slice(0,c.maxMetaDataSize),d.readAsArrayBuffer(a.getSource())},_parse:function(a,c){if(!(a.byteLength<6)){var d,e,f,g,h=new DataView(a),i=2,j=h.byteLength-4,k=i,l={};if(65496===h.getUint16(0)){for(;j>i&&(d=h.getUint16(i),d>=65504&&65519>=d||65534===d)&&(e=h.getUint16(i+2)+2,!(i+e>h.byteLength));){if(f=b.parsers[d],!c&&f)for(g=0;g<f.length;g+=1)f[g].call(b,h,i,e,l);i+=e,k=i}k>6&&(l.imageHead=a.slice?a.slice(2,k):new Uint8Array(a).subarray(2,k))}return l}},updateImageHead:function(a,b){var c,d,e,f=this._parse(a,!0);return e=2,f.imageHead&&(e=2+f.imageHead.byteLength),d=a.slice?a.slice(e):new Uint8Array(a).subarray(e),c=new Uint8Array(b.byteLength+2+d.byteLength),c[0]=255,c[1]=216,c.set(new Uint8Array(b),2),c.set(new Uint8Array(d),b.byteLength+2),c.buffer}},a.parseMeta=function(){return b.parse.apply(b,arguments)},a.updateImageHead=function(){return b.updateImageHead.apply(b,arguments)},b}),b("runtime/html5/imagemeta/exif",["base","runtime/html5/imagemeta"],function(a,b){var c={};return c.ExifMap=function(){return this},c.ExifMap.prototype.map={Orientation:274},c.ExifMap.prototype.get=function(a){return this[a]||this[this.map[a]]},c.exifTagTypes={1:{getValue:function(a,b){return a.getUint8(b)},size:1},2:{getValue:function(a,b){return String.fromCharCode(a.getUint8(b))},size:1,ascii:!0},3:{getValue:function(a,b,c){return a.getUint16(b,c)},size:2},4:{getValue:function(a,b,c){return a.getUint32(b,c)},size:4},5:{getValue:function(a,b,c){return a.getUint32(b,c)/a.getUint32(b+4,c)},size:8},9:{getValue:function(a,b,c){return a.getInt32(b,c)},size:4},10:{getValue:function(a,b,c){return a.getInt32(b,c)/a.getInt32(b+4,c)},size:8}},c.exifTagTypes[7]=c.exifTagTypes[1],c.getExifValue=function(b,d,e,f,g,h){var i,j,k,l,m,n,o=c.exifTagTypes[f];if(!o)return a.log("Invalid Exif data: Invalid tag type."),void 0;if(i=o.size*g,j=i>4?d+b.getUint32(e+8,h):e+8,j+i>b.byteLength)return a.log("Invalid Exif data: Invalid data offset."),void 0;if(1===g)return o.getValue(b,j,h);for(k=[],l=0;g>l;l+=1)k[l]=o.getValue(b,j+l*o.size,h);if(o.ascii){for(m="",l=0;l<k.length&&(n=k[l],"\0"!==n);l+=1)m+=n;return m}return k},c.parseExifTag=function(a,b,d,e,f){var g=a.getUint16(d,e);f.exif[g]=c.getExifValue(a,b,d,a.getUint16(d+2,e),a.getUint32(d+4,e