pica 7.1.0 → 7.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/pica.js +3 -2
- package/dist/pica.min.js +1 -1
- package/lib/worker.js +3 -1
- package/package.json +5 -5
- package/CHANGELOG.md +0 -345
package/dist/pica.js
CHANGED
|
@@ -1112,8 +1112,9 @@ module.exports = function () {
|
|
|
1112
1112
|
canvas.width = canvas.height = 0;
|
|
1113
1113
|
canvas = null;
|
|
1114
1114
|
tileOpts.srcBitmap.close();
|
|
1115
|
-
tileOpts.srcBitmap = null;
|
|
1116
|
-
|
|
1115
|
+
tileOpts.srcBitmap = null; // Temporary force out data to typed array, because Chrome have artefacts
|
|
1116
|
+
// https://github.com/nodeca/pica/issues/223
|
|
1117
|
+
// returnBitmap = true;
|
|
1117
1118
|
}
|
|
1118
1119
|
|
|
1119
1120
|
if (!mathLib) mathLib = new MathLib(ev.data.features); // Use multimath's sync auto-init. Avoid Promise use in old browsers,
|
package/dist/pica.min.js
CHANGED
|
@@ -4,7 +4,7 @@ pica
|
|
|
4
4
|
https://github.com/nodeca/pica
|
|
5
5
|
|
|
6
6
|
*/
|
|
7
|
-
!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).pica=t()}}((function(){return function t(e,r,i){function n(a,o){if(!r[a]){if(!e[a]){var s="function"==typeof require&&require;if(!o&&s)return s(a,!0);if(A)return A(a,!0);var u=new Error("Cannot find module '"+a+"'");throw u.code="MODULE_NOT_FOUND",u}var h=r[a]={exports:{}};e[a][0].call(h.exports,(function(t){return n(e[a][1][t]||t)}),h,h.exports,t,e,r,i)}return r[a].exports}for(var A="function"==typeof require&&require,a=0;a<i.length;a++)n(i[a]);return n}({1:[function(t,e,r){"use strict";var i=t("inherits"),n=t("multimath"),A=t("./mm_unsharp_mask"),a=t("./mm_resize");function o(t){var e=t||[],r={js:e.indexOf("js")>=0,wasm:e.indexOf("wasm")>=0};n.call(this,r),this.features={js:r.js,wasm:r.wasm&&this.has_wasm()},this.use(A),this.use(a)}i(o,n),o.prototype.resizeAndUnsharp=function(t,e){var r=this.resize(t,e);return t.unsharpAmount&&this.unsharp_mask(r,t.toWidth,t.toHeight,t.unsharpAmount,t.unsharpRadius,t.unsharpThreshold),r},e.exports=o},{"./mm_resize":4,"./mm_unsharp_mask":9,inherits:19,multimath:20}],2:[function(t,e,r){"use strict";function i(t){return t<0?0:t>255?255:t}e.exports={convolveHorizontally:function(t,e,r,n,A,a){var o,s,u,h,c,f,l,g,d,p,m,I=0,w=0;for(d=0;d<n;d++){for(c=0,p=0;p<A;p++){for(f=a[c++],l=a[c++],g=I+4*f|0,o=s=u=h=0;l>0;l--)h=h+(m=a[c++])*t[g+3]|0,u=u+m*t[g+2]|0,s=s+m*t[g+1]|0,o=o+m*t[g]|0,g=g+4|0;e[w+3]=i(h+8192>>14),e[w+2]=i(u+8192>>14),e[w+1]=i(s+8192>>14),e[w]=i(o+8192>>14),w=w+4*n|0}w=4*(d+1)|0,I=(d+1)*r*4|0}},convolveVertically:function(t,e,r,n,A,a){var o,s,u,h,c,f,l,g,d,p,m,I=0,w=0;for(d=0;d<n;d++){for(c=0,p=0;p<A;p++){for(f=a[c++],l=a[c++],g=I+4*f|0,o=s=u=h=0;l>0;l--)h=h+(m=a[c++])*t[g+3]|0,u=u+m*t[g+2]|0,s=s+m*t[g+1]|0,o=o+m*t[g]|0,g=g+4|0;e[w+3]=i(h+8192>>14),e[w+2]=i(u+8192>>14),e[w+1]=i(s+8192>>14),e[w]=i(o+8192>>14),w=w+4*n|0}w=4*(d+1)|0,I=(d+1)*r*4|0}}}},{}],3:[function(t,e,r){"use strict";e.exports="AGFzbQEAAAAADAZkeWxpbmsAAAAAAAEXA2AAAGAGf39/f39/AGAHf39/f39/fwACDwEDZW52Bm1lbW9yeQIAAAMEAwABAgYGAX8AQQALB1cFEV9fd2FzbV9jYWxsX2N0b3JzAAAIY29udm9sdmUAAQpjb252b2x2ZUhWAAIMX19kc29faGFuZGxlAwAYX193YXNtX2FwcGx5X2RhdGFfcmVsb2NzAAAK7AMDAwABC8YDAQ9/AkAgA0UNACAERQ0AA0AgDCENQQAhE0EAIQcDQCAHQQJqIQYCfyAHQQF0IAVqIgcuAQIiFEUEQEGAwAAhCEGAwAAhCUGAwAAhCkGAwAAhCyAGDAELIBIgBy4BAGohCEEAIQsgFCEHQQAhDiAGIQlBACEPQQAhEANAIAUgCUEBdGouAQAiESAAIAhBAnRqKAIAIgpBGHZsIBBqIRAgCkH/AXEgEWwgC2ohCyAKQRB2Qf8BcSARbCAPaiEPIApBCHZB/wFxIBFsIA5qIQ4gCEEBaiEIIAlBAWohCSAHQQFrIgcNAAsgC0GAQGshCCAOQYBAayEJIA9BgEBrIQogEEGAQGshCyAGIBRqCyEHIAEgDUECdGogCUEOdSIGQf8BIAZB/wFIGyIGQQAgBkEAShtBCHRBgP4DcSAKQQ51IgZB/wEgBkH/AUgbIgZBACAGQQBKG0EQdEGAgPwHcSALQQ51IgZB/wEgBkH/AUgbIgZBACAGQQBKG0EYdHJyIAhBDnUiBkH/ASAGQf8BSBsiBkEAIAZBAEobcjYCACADIA1qIQ0gE0EBaiITIARHDQALIAxBAWoiDCACbCESIAMgDEcNAAsLCx4AQQAgAiADIAQgBSAAEAEgAkEAIAQgBSAGIAEQAQs="},{}],4:[function(t,e,r){"use strict";e.exports={name:"resize",fn:t("./resize"),wasm_fn:t("./resize_wasm"),wasm_src:t("./convolve_wasm_base64")}},{"./convolve_wasm_base64":3,"./resize":5,"./resize_wasm":8}],5:[function(t,e,r){"use strict";var i=t("./resize_filter_gen"),n=t("./convolve").convolveHorizontally,A=t("./convolve").convolveVertically;e.exports=function(t){var e=t.src,r=t.width,a=t.height,o=t.toWidth,s=t.toHeight,u=t.scaleX||t.toWidth/t.width,h=t.scaleY||t.toHeight/t.height,c=t.offsetX||0,f=t.offsetY||0,l=t.dest||new Uint8Array(o*s*4),g=void 0===t.quality?3:t.quality,d=t.alpha||!1,p=i(g,r,o,u,c),m=i(g,a,s,h,f),I=new Uint8Array(o*a*4);return n(e,I,r,a,o,p),A(I,l,a,o,s,m),d||function(t,e,r){for(var i=3,n=e*r*4|0;i<n;)t[i]=255,i=i+4|0}(l,o,s),l}},{"./convolve":2,"./resize_filter_gen":6}],6:[function(t,e,r){"use strict";var i=t("./resize_filter_info");function n(t){return Math.round(16383*t)}e.exports=function(t,e,r,A,a){var o,s,u,h,c,f,l,g,d,p,m,I,w,_,B,b,y,v=i[t].filter,Q=1/A,C=Math.min(1,A),E=i[t].win/C,M=Math.floor(2*(E+1)),x=new Int16Array((M+2)*r),D=0,G=!x.subarray||!x.set;for(o=0;o<r;o++){for(s=(o+.5)*Q+a,u=Math.max(0,Math.floor(s-E)),c=(h=Math.min(e-1,Math.ceil(s+E)))-u+1,f=new Float32Array(c),l=new Int16Array(c),g=0,d=u,p=0;d<=h;d++,p++)g+=m=v((d+.5-s)*C),f[p]=m;for(I=0,p=0;p<f.length;p++)I+=w=f[p]/g,l[p]=n(w);for(l[r>>1]+=n(1-I),_=0;_<l.length&&0===l[_];)_++;if(_<l.length){for(B=l.length-1;B>0&&0===l[B];)B--;if(b=u+_,y=B-_+1,x[D++]=b,x[D++]=y,G)for(p=_;p<=B;p++)x[D++]=l[p];else x.set(l.subarray(_,B+1),D),D+=y}else x[D++]=0,x[D++]=0}return x}},{"./resize_filter_info":7}],7:[function(t,e,r){"use strict";e.exports=[{win:.5,filter:function(t){return t>=-.5&&t<.5?1:0}},{win:1,filter:function(t){if(t<=-1||t>=1)return 0;if(t>-1.1920929e-7&&t<1.1920929e-7)return 1;var e=t*Math.PI;return Math.sin(e)/e*(.54+.46*Math.cos(e/1))}},{win:2,filter:function(t){if(t<=-2||t>=2)return 0;if(t>-1.1920929e-7&&t<1.1920929e-7)return 1;var e=t*Math.PI;return Math.sin(e)/e*Math.sin(e/2)/(e/2)}},{win:3,filter:function(t){if(t<=-3||t>=3)return 0;if(t>-1.1920929e-7&&t<1.1920929e-7)return 1;var e=t*Math.PI;return Math.sin(e)/e*Math.sin(e/3)/(e/3)}}]},{}],8:[function(t,e,r){"use strict";var i=t("./resize_filter_gen");var n=!0;try{n=1===new Uint32Array(new Uint8Array([1,0,0,0]).buffer)[0]}catch(t){}function A(t,e,r){if(n)e.set(function(t){return new Uint8Array(t.buffer,0,t.byteLength)}(t),r);else for(var i=r,A=0;A<t.length;A++){var a=t[A];e[i++]=255&a,e[i++]=a>>8&255}}e.exports=function(t){var e=t.src,r=t.width,n=t.height,a=t.toWidth,o=t.toHeight,s=t.scaleX||t.toWidth/t.width,u=t.scaleY||t.toHeight/t.height,h=t.offsetX||0,c=t.offsetY||0,f=t.dest||new Uint8Array(a*o*4),l=void 0===t.quality?3:t.quality,g=t.alpha||!1,d=i(l,r,a,s,h),p=i(l,n,o,u,c),m=this.__align(0+Math.max(e.byteLength,f.byteLength)),I=this.__align(m+n*a*4),w=this.__align(I+d.byteLength),_=w+p.byteLength,B=this.__instance("resize",_),b=new Uint8Array(this.__memory.buffer),y=new Uint32Array(this.__memory.buffer),v=new Uint32Array(e.buffer);return y.set(v),A(d,b,I),A(p,b,w),(B.exports.convolveHV||B.exports._convolveHV)(I,w,m,r,n,a,o),new Uint32Array(f.buffer).set(new Uint32Array(this.__memory.buffer,0,o*a)),g||function(t,e,r){for(var i=3,n=e*r*4|0;i<n;)t[i]=255,i=i+4|0}(f,a,o),f}},{"./resize_filter_gen":6}],9:[function(t,e,r){"use strict";e.exports={name:"unsharp_mask",fn:t("./unsharp_mask"),wasm_fn:t("./unsharp_mask_wasm"),wasm_src:t("./unsharp_mask_wasm_base64")}},{"./unsharp_mask":10,"./unsharp_mask_wasm":11,"./unsharp_mask_wasm_base64":12}],10:[function(t,e,r){"use strict";var i=t("glur/mono16");e.exports=function(t,e,r,n,A,a){var o,s,u,h,c;if(!(0===n||A<.5)){A>2&&(A=2);var f=function(t,e,r){for(var i,n,A,a,o=e*r,s=new Uint16Array(o),u=0;u<o;u++)i=t[4*u],n=t[4*u+1],A=t[4*u+2],a=i>=n&&i>=A?i:n>=A&&n>=i?n:A,s[u]=a<<8;return s}(t,e,r),l=new Uint16Array(f);i(l,e,r,A);for(var g=n/100*4096+.5|0,d=a<<8,p=e*r,m=0;m<p;m++)h=(o=f[m])-l[m],Math.abs(h)>=d&&(u=((s=(s=(s=o+(g*h+2048>>12))>65280?65280:s)<0?0:s)<<12)/(o=0!==o?o:1)|0,t[c=4*m]=t[c]*u+2048>>12,t[c+1]=t[c+1]*u+2048>>12,t[c+2]=t[c+2]*u+2048>>12)}}},{"glur/mono16":18}],11:[function(t,e,r){"use strict";e.exports=function(t,e,r,i,n,A){if(!(0===i||n<.5)){n>2&&(n=2);var a=e*r,o=4*a,s=2*a,u=2*a,h=4*Math.max(e,r),c=o,f=c+s,l=f+u,g=l+u,d=g+h,p=this.__instance("unsharp_mask",o+s+2*u+h+32,{exp:Math.exp}),m=new Uint32Array(t.buffer);new Uint32Array(this.__memory.buffer).set(m);var I=p.exports.hsv_v16||p.exports._hsv_v16;I(0,c,e,r),(I=p.exports.blurMono16||p.exports._blurMono16)(c,f,l,g,d,e,r,n),(I=p.exports.unsharp||p.exports._unsharp)(0,0,c,f,e,r,i,A),m.set(new Uint32Array(this.__memory.buffer,0,a))}}},{}],12:[function(t,e,r){"use strict";e.exports="AGFzbQEAAAAADAZkeWxpbmsAAAAAAAE0B2AAAGAEf39/fwBgBn9/f39/fwBgCH9/f39/f39/AGAIf39/f39/f30AYAJ9fwBgAXwBfAIZAgNlbnYDZXhwAAYDZW52Bm1lbW9yeQIAAAMHBgAFAgQBAwYGAX8AQQALB4oBCBFfX3dhc21fY2FsbF9jdG9ycwABFl9fYnVpbGRfZ2F1c3NpYW5fY29lZnMAAg5fX2dhdXNzMTZfbGluZQADCmJsdXJNb25vMTYABAdoc3ZfdjE2AAUHdW5zaGFycAAGDF9f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AEGpBDHY6AAALIAZBAWoiBiAERw0ACwsL"},{}],13:[function(t,e,r){"use strict";function i(t,e){this.create=t,this.available=[],this.acquired={},this.lastId=1,this.timeoutId=0,this.idle=e||2e3}i.prototype.acquire=function(){var t,e=this;return 0!==this.available.length?t=this.available.pop():((t=this.create()).id=this.lastId++,t.release=function(){return e.release(t)}),this.acquired[t.id]=t,t},i.prototype.release=function(t){var e=this;delete this.acquired[t.id],t.lastUsed=Date.now(),this.available.push(t),0===this.timeoutId&&(this.timeoutId=setTimeout((function(){return e.gc()}),100))},i.prototype.gc=function(){var t=this,e=Date.now();this.available=this.available.filter((function(r){return!(e-r.lastUsed>t.idle)||(r.destroy(),!1)})),0!==this.available.length?this.timeoutId=setTimeout((function(){return t.gc()}),100):this.timeoutId=0},e.exports=i},{}],14:[function(t,e,r){"use strict";e.exports=function(t,e,r,i,n,A){var a=r/t,o=i/e,s=(2*A+2+1)/n;if(s>.5)return[[r,i]];var u=Math.ceil(Math.log(Math.min(a,o))/Math.log(s));if(u<=1)return[[r,i]];for(var h=[],c=0;c<u;c++){var f=Math.round(Math.pow(Math.pow(t,u-c-1)*Math.pow(r,c+1),1/u)),l=Math.round(Math.pow(Math.pow(e,u-c-1)*Math.pow(i,c+1),1/u));h.push([f,l])}return h}},{}],15:[function(t,e,r){"use strict";function i(t){var e=Math.round(t);return Math.abs(t-e)<1e-5?e:Math.floor(t)}function n(t){var e=Math.round(t);return Math.abs(t-e)<1e-5?e:Math.ceil(t)}e.exports=function(t){var e,r,A,a,o,s,u=t.toWidth/t.width,h=t.toHeight/t.height,c=i(t.srcTileSize*u)-2*t.destTileBorder,f=i(t.srcTileSize*h)-2*t.destTileBorder;if(c<1||f<1)throw new Error("Internal error in pica: target tile width/height is too small.");var l,g=[];for(a=0;a<t.toHeight;a+=f)for(A=0;A<t.toWidth;A+=c)(e=A-t.destTileBorder)<0&&(e=0),e+(o=A+c+t.destTileBorder-e)>=t.toWidth&&(o=t.toWidth-e),(r=a-t.destTileBorder)<0&&(r=0),r+(s=a+f+t.destTileBorder-r)>=t.toHeight&&(s=t.toHeight-r),l={toX:e,toY:r,toWidth:o,toHeight:s,toInnerX:A,toInnerY:a,toInnerWidth:c,toInnerHeight:f,offsetX:e/u-i(e/u),offsetY:r/h-i(r/h),scaleX:u,scaleY:h,x:i(e/u),y:i(r/h),width:n(o/u),height:n(s/h)},g.push(l);return g}},{}],16:[function(t,e,r){"use strict";function i(t){return Object.prototype.toString.call(t)}e.exports.isCanvas=function(t){var e=i(t);return"[object HTMLCanvasElement]"===e||"[object OffscreenCanvas]"===e||"[object Canvas]"===e},e.exports.isImage=function(t){return"[object HTMLImageElement]"===i(t)},e.exports.isImageBitmap=function(t){return"[object ImageBitmap]"===i(t)},e.exports.limiter=function(t){var e=0,r=[];function i(){e<t&&r.length&&(e++,r.shift()())}return function(t){return new Promise((function(n,A){r.push((function(){t().then((function(t){n(t),e--,i()}),(function(t){A(t),e--,i()}))})),i()}))}},e.exports.cib_quality_name=function(t){switch(t){case 0:return"pixelated";case 1:return"low";case 2:return"medium"}return"high"},e.exports.cib_support=function(t){return Promise.resolve().then((function(){if("undefined"==typeof createImageBitmap)return!1;var e=t(100,100);return createImageBitmap(e,0,0,100,100,{resizeWidth:10,resizeHeight:10,resizeQuality:"high"}).then((function(t){var r=10===t.width;return t.close(),e=null,r}))})).catch((function(){return!1}))},e.exports.worker_offscreen_canvas_support=function(){return new Promise((function(t,e){if("undefined"!=typeof OffscreenCanvas){var r=btoa("(".concat(function(t){"undefined"!=typeof createImageBitmap?Promise.resolve().then((function(){var t=new OffscreenCanvas(10,10);return t.getContext("2d").rect(0,0,1,1),createImageBitmap(t,0,0,1,1)})).then((function(){return t.postMessage(!0)}),(function(){return t.postMessage(!1)})):t.postMessage(!1)}.toString(),")(self);")),i=new Worker("data:text/javascript;base64,".concat(r));i.onmessage=function(e){return t(e.data)},i.onerror=e}else t(!1)})).then((function(t){return t}),(function(){return!1}))},e.exports.can_use_canvas=function(t){var e=!1;try{var r=t(2,1).getContext("2d"),i=r.createImageData(2,1);i.data[0]=12,i.data[1]=23,i.data[2]=34,i.data[3]=255,i.data[4]=45,i.data[5]=56,i.data[6]=67,i.data[7]=255,r.putImageData(i,0,0),i=null,12===(i=r.getImageData(0,0,2,1)).data[0]&&23===i.data[1]&&34===i.data[2]&&255===i.data[3]&&45===i.data[4]&&56===i.data[5]&&67===i.data[6]&&255===i.data[7]&&(e=!0)}catch(t){}return e},e.exports.cib_can_use_region=function(){return new Promise((function(t){if("undefined"!=typeof createImageBitmap){var e=new Image;e.src="data:image/jpeg;base64,/9j/4QBiRXhpZgAATU0AKgAAAAgABQESAAMAAAABAAYAAAEaAAUAAAABAAAASgEbAAUAAAABAAAAUgEoAAMAAAABAAIAAAITAAMAAAABAAEAAAAAAAAAAABIAAAAAQAAAEgAAAAB/9sAQwAEAwMEAwMEBAMEBQQEBQYKBwYGBgYNCQoICg8NEBAPDQ8OERMYFBESFxIODxUcFRcZGRsbGxAUHR8dGh8YGhsa/9sAQwEEBQUGBQYMBwcMGhEPERoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoa/8IAEQgAAQACAwERAAIRAQMRAf/EABQAAQAAAAAAAAAAAAAAAAAAAAf/xAAUAQEAAAAAAAAAAAAAAAAAAAAA/9oADAMBAAIQAxAAAAF/P//EABQQAQAAAAAAAAAAAAAAAAAAAAD/2gAIAQEAAQUCf//EABQRAQAAAAAAAAAAAAAAAAAAAAD/2gAIAQMBAT8Bf//EABQRAQAAAAAAAAAAAAAAAAAAAAD/2gAIAQIBAT8Bf//EABQQAQAAAAAAAAAAAAAAAAAAAAD/2gAIAQEABj8Cf//EABQQAQAAAAAAAAAAAAAAAAAAAAD/2gAIAQEAAT8hf//aAAwDAQACAAMAAAAQH//EABQRAQAAAAAAAAAAAAAAAAAAAAD/2gAIAQMBAT8Qf//EABQRAQAAAAAAAAAAAAAAAAAAAAD/2gAIAQIBAT8Qf//EABQQAQAAAAAAAAAAAAAAAAAAAAD/2gAIAQEAAT8Qf//Z",e.onload=function(){createImageBitmap(e,0,0,e.width,e.height).then((function(r){r.width===e.width&&r.height===e.height?t(!0):t(!1)}),(function(){return t(!1)}))},e.onerror=function(){return t(!1)}}else t(!1)}))}},{}],17:[function(t,e,r){"use strict";e.exports=function(){var e,r=t("./mathlib");onmessage=function(t){var i=t.data.opts,n=!1;if(!i.src&&i.srcBitmap){var A=new OffscreenCanvas(i.width,i.height),a=A.getContext("2d",{alpha:Boolean(i.alpha)});a.drawImage(i.srcBitmap,0,0),i.src=a.getImageData(0,0,i.width,i.height).data,A.width=A.height=0,A=null,i.srcBitmap.close(),i.srcBitmap=null,n=!0}e||(e=new r(t.data.features));var o=e.resizeAndUnsharp(i);if(n){var s=new ImageData(new Uint8ClampedArray(o),i.toWidth,i.toHeight),u=new OffscreenCanvas(i.toWidth,i.toHeight);u.getContext("2d",{alpha:Boolean(i.alpha)}).putImageData(s,0,0),createImageBitmap(u).then((function(t){postMessage({bitmap:t},[t])}))}else postMessage({data:o},[o.buffer])}}},{"./mathlib":1}],18:[function(t,e,r){var i,n,A,a,o,s;function u(t,e,r,i,n,A){var a,o,s,u,h,c,f,l,g,d,p,m,I,w;for(g=0;g<A;g++){for(f=g,l=0,u=h=(a=t[c=g*n])*i[6],p=i[0],m=i[1],I=i[4],w=i[5],d=0;d<n;d++)s=(o=t[c])*p+a*m+u*I+h*w,h=u,u=s,a=o,r[l]=u,l++,c++;for(l--,f+=A*(n-1),u=h=(a=t[--c])*i[7],o=a,p=i[2],m=i[3],d=n-1;d>=0;d--)s=o*p+a*m+u*I+h*w,h=u,u=s,a=o,o=t[c],e[f]=r[l]+u,c--,l--,f-=A}}e.exports=function(t,e,r,h){if(h){var c=new Uint16Array(t.length),f=new Float32Array(Math.max(e,r)),l=function(t){t<.5&&(t=.5);var e=Math.exp(.527076)/t,r=Math.exp(-e),u=Math.exp(-2*e),h=(1-r)*(1-r)/(1+2*e*r-u);return i=h,n=h*(e-1)*r,A=h*(e+1)*r,a=-h*u,o=2*r,s=-u,new Float32Array([i,n,A,a,o,s,(i+n)/(1-o-s),(A+a)/(1-o-s)])}(h);u(t,c,f,l,e,r),u(c,t,f,l,r,e)}}},{}],19:[function(t,e,r){"function"==typeof Object.create?e.exports=function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(t,e){if(e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}}},{}],20:[function(t,e,r){"use strict";var i=t("object-assign"),n=t("./lib/base64decode"),A=t("./lib/wa_detect"),a={js:!0,wasm:!0};function o(t){if(!(this instanceof o))return new o(t);var e=i({},a,t||{});if(this.options=e,this.__cache={},this.__init_promise=null,this.__modules=e.modules||{},this.__memory=null,this.__wasm={},this.__isLE=1===new Uint32Array(new Uint8Array([1,0,0,0]).buffer)[0],!this.options.js&&!this.options.wasm)throw new Error('mathlib: at least "js" or "wasm" should be enabled')}o.prototype.has_wasm=A,o.prototype.use=function(t){return this.__modules[t.name]=t,this.options.wasm&&this.has_wasm()&&t.wasm_fn?this[t.name]=t.wasm_fn:this[t.name]=t.fn,this},o.prototype.init=function(){if(this.__init_promise)return this.__init_promise;if(!this.options.js&&this.options.wasm&&!this.has_wasm())return Promise.reject(new Error('mathlib: only "wasm" was enabled, but it\'s not supported'));var t=this;return this.__init_promise=Promise.all(Object.keys(t.__modules).map((function(e){var r=t.__modules[e];return t.options.wasm&&t.has_wasm()&&r.wasm_fn?t.__wasm[e]?null:WebAssembly.compile(t.__base64decode(r.wasm_src)).then((function(r){t.__wasm[e]=r})):null}))).then((function(){return t})),this.__init_promise},o.prototype.__base64decode=n,o.prototype.__reallocate=function(t){if(!this.__memory)return this.__memory=new WebAssembly.Memory({initial:Math.ceil(t/65536)}),this.__memory;var e=this.__memory.buffer.byteLength;return e<t&&this.__memory.grow(Math.ceil((t-e)/65536)),this.__memory},o.prototype.__instance=function(t,e,r){if(e&&this.__reallocate(e),!this.__wasm[t]){var n=this.__modules[t];this.__wasm[t]=new WebAssembly.Module(this.__base64decode(n.wasm_src))}if(!this.__cache[t]){var A={memoryBase:0,memory:this.__memory,tableBase:0,table:new WebAssembly.Table({initial:0,element:"anyfunc"})};this.__cache[t]=new WebAssembly.Instance(this.__wasm[t],{env:i(A,r||{})})}return this.__cache[t]},o.prototype.__align=function(t,e){var r=t%(e=e||8);return t+(r?e-r:0)},e.exports=o},{"./lib/base64decode":21,"./lib/wa_detect":22,"object-assign":23}],21:[function(t,e,r){"use strict";e.exports=function(t){for(var e=t.replace(/[\r\n=]/g,""),r=e.length,i=new Uint8Array(3*r>>2),n=0,A=0,a=0;a<r;a++)a%4==0&&a&&(i[A++]=n>>16&255,i[A++]=n>>8&255,i[A++]=255&n),n=n<<6|"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(e.charAt(a));var o=r%4*6;return 0===o?(i[A++]=n>>16&255,i[A++]=n>>8&255,i[A++]=255&n):18===o?(i[A++]=n>>10&255,i[A++]=n>>2&255):12===o&&(i[A++]=n>>4&255),i}},{}],22:[function(t,e,r){"use strict";var i;e.exports=function(){if(void 0!==i)return i;if(i=!1,"undefined"==typeof WebAssembly)return i;try{var t=new Uint8Array([0,97,115,109,1,0,0,0,1,6,1,96,1,127,1,127,3,2,1,0,5,3,1,0,1,7,8,1,4,116,101,115,116,0,0,10,16,1,14,0,32,0,65,1,54,2,0,32,0,40,2,0,11]),e=new WebAssembly.Module(t);return 0!==new WebAssembly.Instance(e,{}).exports.test(4)&&(i=!0),i}catch(t){}return i}},{}],23:[function(t,e,r){
|
|
7
|
+
!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).pica=t()}}((function(){return function t(e,r,i){function n(a,o){if(!r[a]){if(!e[a]){var s="function"==typeof require&&require;if(!o&&s)return s(a,!0);if(A)return A(a,!0);var u=new Error("Cannot find module '"+a+"'");throw u.code="MODULE_NOT_FOUND",u}var h=r[a]={exports:{}};e[a][0].call(h.exports,(function(t){return n(e[a][1][t]||t)}),h,h.exports,t,e,r,i)}return r[a].exports}for(var A="function"==typeof require&&require,a=0;a<i.length;a++)n(i[a]);return n}({1:[function(t,e,r){"use strict";var i=t("inherits"),n=t("multimath"),A=t("./mm_unsharp_mask"),a=t("./mm_resize");function o(t){var e=t||[],r={js:e.indexOf("js")>=0,wasm:e.indexOf("wasm")>=0};n.call(this,r),this.features={js:r.js,wasm:r.wasm&&this.has_wasm()},this.use(A),this.use(a)}i(o,n),o.prototype.resizeAndUnsharp=function(t,e){var r=this.resize(t,e);return t.unsharpAmount&&this.unsharp_mask(r,t.toWidth,t.toHeight,t.unsharpAmount,t.unsharpRadius,t.unsharpThreshold),r},e.exports=o},{"./mm_resize":4,"./mm_unsharp_mask":9,inherits:19,multimath:20}],2:[function(t,e,r){"use strict";function i(t){return t<0?0:t>255?255:t}e.exports={convolveHorizontally:function(t,e,r,n,A,a){var o,s,u,h,c,f,l,g,d,p,m,I=0,w=0;for(d=0;d<n;d++){for(c=0,p=0;p<A;p++){for(f=a[c++],l=a[c++],g=I+4*f|0,o=s=u=h=0;l>0;l--)h=h+(m=a[c++])*t[g+3]|0,u=u+m*t[g+2]|0,s=s+m*t[g+1]|0,o=o+m*t[g]|0,g=g+4|0;e[w+3]=i(h+8192>>14),e[w+2]=i(u+8192>>14),e[w+1]=i(s+8192>>14),e[w]=i(o+8192>>14),w=w+4*n|0}w=4*(d+1)|0,I=(d+1)*r*4|0}},convolveVertically:function(t,e,r,n,A,a){var o,s,u,h,c,f,l,g,d,p,m,I=0,w=0;for(d=0;d<n;d++){for(c=0,p=0;p<A;p++){for(f=a[c++],l=a[c++],g=I+4*f|0,o=s=u=h=0;l>0;l--)h=h+(m=a[c++])*t[g+3]|0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}],4:[function(t,e,r){"use strict";e.exports={name:"resize",fn:t("./resize"),wasm_fn:t("./resize_wasm"),wasm_src:t("./convolve_wasm_base64")}},{"./convolve_wasm_base64":3,"./resize":5,"./resize_wasm":8}],5:[function(t,e,r){"use strict";var i=t("./resize_filter_gen"),n=t("./convolve").convolveHorizontally,A=t("./convolve").convolveVertically;e.exports=function(t){var e=t.src,r=t.width,a=t.height,o=t.toWidth,s=t.toHeight,u=t.scaleX||t.toWidth/t.width,h=t.scaleY||t.toHeight/t.height,c=t.offsetX||0,f=t.offsetY||0,l=t.dest||new Uint8Array(o*s*4),g=void 0===t.quality?3:t.quality,d=t.alpha||!1,p=i(g,r,o,u,c),m=i(g,a,s,h,f),I=new Uint8Array(o*a*4);return n(e,I,r,a,o,p),A(I,l,a,o,s,m),d||function(t,e,r){for(var i=3,n=e*r*4|0;i<n;)t[i]=255,i=i+4|0}(l,o,s),l}},{"./convolve":2,"./resize_filter_gen":6}],6:[function(t,e,r){"use strict";var i=t("./resize_filter_info");function n(t){return Math.round(16383*t)}e.exports=function(t,e,r,A,a){var o,s,u,h,c,f,l,g,d,p,m,I,w,_,B,b,y,v=i[t].filter,Q=1/A,C=Math.min(1,A),E=i[t].win/C,M=Math.floor(2*(E+1)),x=new Int16Array((M+2)*r),D=0,G=!x.subarray||!x.set;for(o=0;o<r;o++){for(s=(o+.5)*Q+a,u=Math.max(0,Math.floor(s-E)),c=(h=Math.min(e-1,Math.ceil(s+E)))-u+1,f=new Float32Array(c),l=new Int16Array(c),g=0,d=u,p=0;d<=h;d++,p++)g+=m=v((d+.5-s)*C),f[p]=m;for(I=0,p=0;p<f.length;p++)I+=w=f[p]/g,l[p]=n(w);for(l[r>>1]+=n(1-I),_=0;_<l.length&&0===l[_];)_++;if(_<l.length){for(B=l.length-1;B>0&&0===l[B];)B--;if(b=u+_,y=B-_+1,x[D++]=b,x[D++]=y,G)for(p=_;p<=B;p++)x[D++]=l[p];else x.set(l.subarray(_,B+1),D),D+=y}else x[D++]=0,x[D++]=0}return x}},{"./resize_filter_info":7}],7:[function(t,e,r){"use strict";e.exports=[{win:.5,filter:function(t){return t>=-.5&&t<.5?1:0}},{win:1,filter:function(t){if(t<=-1||t>=1)return 0;if(t>-1.1920929e-7&&t<1.1920929e-7)return 1;var e=t*Math.PI;return Math.sin(e)/e*(.54+.46*Math.cos(e/1))}},{win:2,filter:function(t){if(t<=-2||t>=2)return 0;if(t>-1.1920929e-7&&t<1.1920929e-7)return 1;var e=t*Math.PI;return Math.sin(e)/e*Math.sin(e/2)/(e/2)}},{win:3,filter:function(t){if(t<=-3||t>=3)return 0;if(t>-1.1920929e-7&&t<1.1920929e-7)return 1;var e=t*Math.PI;return Math.sin(e)/e*Math.sin(e/3)/(e/3)}}]},{}],8:[function(t,e,r){"use strict";var i=t("./resize_filter_gen");var n=!0;try{n=1===new Uint32Array(new Uint8Array([1,0,0,0]).buffer)[0]}catch(t){}function A(t,e,r){if(n)e.set(function(t){return new Uint8Array(t.buffer,0,t.byteLength)}(t),r);else for(var i=r,A=0;A<t.length;A++){var a=t[A];e[i++]=255&a,e[i++]=a>>8&255}}e.exports=function(t){var e=t.src,r=t.width,n=t.height,a=t.toWidth,o=t.toHeight,s=t.scaleX||t.toWidth/t.width,u=t.scaleY||t.toHeight/t.height,h=t.offsetX||0,c=t.offsetY||0,f=t.dest||new Uint8Array(a*o*4),l=void 0===t.quality?3:t.quality,g=t.alpha||!1,d=i(l,r,a,s,h),p=i(l,n,o,u,c),m=this.__align(0+Math.max(e.byteLength,f.byteLength)),I=this.__align(m+n*a*4),w=this.__align(I+d.byteLength),_=w+p.byteLength,B=this.__instance("resize",_),b=new Uint8Array(this.__memory.buffer),y=new Uint32Array(this.__memory.buffer),v=new Uint32Array(e.buffer);return y.set(v),A(d,b,I),A(p,b,w),(B.exports.convolveHV||B.exports._convolveHV)(I,w,m,r,n,a,o),new Uint32Array(f.buffer).set(new Uint32Array(this.__memory.buffer,0,o*a)),g||function(t,e,r){for(var i=3,n=e*r*4|0;i<n;)t[i]=255,i=i+4|0}(f,a,o),f}},{"./resize_filter_gen":6}],9:[function(t,e,r){"use strict";e.exports={name:"unsharp_mask",fn:t("./unsharp_mask"),wasm_fn:t("./unsharp_mask_wasm"),wasm_src:t("./unsharp_mask_wasm_base64")}},{"./unsharp_mask":10,"./unsharp_mask_wasm":11,"./unsharp_mask_wasm_base64":12}],10:[function(t,e,r){"use strict";var i=t("glur/mono16");e.exports=function(t,e,r,n,A,a){var o,s,u,h,c;if(!(0===n||A<.5)){A>2&&(A=2);var f=function(t,e,r){for(var i,n,A,a,o=e*r,s=new Uint16Array(o),u=0;u<o;u++)i=t[4*u],n=t[4*u+1],A=t[4*u+2],a=i>=n&&i>=A?i:n>=A&&n>=i?n:A,s[u]=a<<8;return s}(t,e,r),l=new Uint16Array(f);i(l,e,r,A);for(var g=n/100*4096+.5|0,d=a<<8,p=e*r,m=0;m<p;m++)h=(o=f[m])-l[m],Math.abs(h)>=d&&(u=((s=(s=(s=o+(g*h+2048>>12))>65280?65280:s)<0?0:s)<<12)/(o=0!==o?o:1)|0,t[c=4*m]=t[c]*u+2048>>12,t[c+1]=t[c+1]*u+2048>>12,t[c+2]=t[c+2]*u+2048>>12)}}},{"glur/mono16":18}],11:[function(t,e,r){"use strict";e.exports=function(t,e,r,i,n,A){if(!(0===i||n<.5)){n>2&&(n=2);var a=e*r,o=4*a,s=2*a,u=2*a,h=4*Math.max(e,r),c=o,f=c+s,l=f+u,g=l+u,d=g+h,p=this.__instance("unsharp_mask",o+s+2*u+h+32,{exp:Math.exp}),m=new Uint32Array(t.buffer);new Uint32Array(this.__memory.buffer).set(m);var I=p.exports.hsv_v16||p.exports._hsv_v16;I(0,c,e,r),(I=p.exports.blurMono16||p.exports._blurMono16)(c,f,l,g,d,e,r,n),(I=p.exports.unsharp||p.exports._unsharp)(0,0,c,f,e,r,i,A),m.set(new Uint32Array(this.__memory.buffer,0,a))}}},{}],12:[function(t,e,r){"use strict";e.exports="AGFzbQEAAAA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AiC5lEAAAAAAAA4EFjBEAgC6oMAQtBgICAgHgLIQUgBARAIAdBCHQhCUEAIQYDQCAJIAIgBkEBdCIHai8BACIBIAMgB2ovAQBrIgcgB0EfdSIIaiAIc00EQCAAIAZBAnQiCGoiCiAFIAdsQYAQakEMdSABaiIHQYD+AyAHQYD+A0gbIgdBACAHQQBKG0EMdCABQQEgARtuIgEgCi0AAGxBgBBqQQx2OgAAIAAgCEEBcmoiByABIActAABsQYAQakEMdjoAACAAIAhBAnJqIgcgASAHLQAAbEGAEGpBDHY6AAALIAZBAWoiBiAERw0ACwsL"},{}],13:[function(t,e,r){"use strict";function i(t,e){this.create=t,this.available=[],this.acquired={},this.lastId=1,this.timeoutId=0,this.idle=e||2e3}i.prototype.acquire=function(){var t,e=this;return 0!==this.available.length?t=this.available.pop():((t=this.create()).id=this.lastId++,t.release=function(){return e.release(t)}),this.acquired[t.id]=t,t},i.prototype.release=function(t){var e=this;delete this.acquired[t.id],t.lastUsed=Date.now(),this.available.push(t),0===this.timeoutId&&(this.timeoutId=setTimeout((function(){return e.gc()}),100))},i.prototype.gc=function(){var t=this,e=Date.now();this.available=this.available.filter((function(r){return!(e-r.lastUsed>t.idle)||(r.destroy(),!1)})),0!==this.available.length?this.timeoutId=setTimeout((function(){return t.gc()}),100):this.timeoutId=0},e.exports=i},{}],14:[function(t,e,r){"use strict";e.exports=function(t,e,r,i,n,A){var a=r/t,o=i/e,s=(2*A+2+1)/n;if(s>.5)return[[r,i]];var u=Math.ceil(Math.log(Math.min(a,o))/Math.log(s));if(u<=1)return[[r,i]];for(var h=[],c=0;c<u;c++){var f=Math.round(Math.pow(Math.pow(t,u-c-1)*Math.pow(r,c+1),1/u)),l=Math.round(Math.pow(Math.pow(e,u-c-1)*Math.pow(i,c+1),1/u));h.push([f,l])}return h}},{}],15:[function(t,e,r){"use strict";var i=1e-5;function n(t){var e=Math.round(t);return Math.abs(t-e)<i?e:Math.floor(t)}function A(t){var e=Math.round(t);return Math.abs(t-e)<i?e:Math.ceil(t)}e.exports=function(t){var e,r,i,a,o,s,u=t.toWidth/t.width,h=t.toHeight/t.height,c=n(t.srcTileSize*u)-2*t.destTileBorder,f=n(t.srcTileSize*h)-2*t.destTileBorder;if(c<1||f<1)throw new Error("Internal error in pica: target tile width/height is too small.");var l,g=[];for(a=0;a<t.toHeight;a+=f)for(i=0;i<t.toWidth;i+=c)(e=i-t.destTileBorder)<0&&(e=0),e+(o=i+c+t.destTileBorder-e)>=t.toWidth&&(o=t.toWidth-e),(r=a-t.destTileBorder)<0&&(r=0),r+(s=a+f+t.destTileBorder-r)>=t.toHeight&&(s=t.toHeight-r),l={toX:e,toY:r,toWidth:o,toHeight:s,toInnerX:i,toInnerY:a,toInnerWidth:c,toInnerHeight:f,offsetX:e/u-n(e/u),offsetY:r/h-n(r/h),scaleX:u,scaleY:h,x:n(e/u),y:n(r/h),width:A(o/u),height:A(s/h)},g.push(l);return g}},{}],16:[function(t,e,r){"use strict";function i(t){return Object.prototype.toString.call(t)}e.exports.isCanvas=function(t){var e=i(t);return"[object HTMLCanvasElement]"===e||"[object OffscreenCanvas]"===e||"[object Canvas]"===e},e.exports.isImage=function(t){return"[object HTMLImageElement]"===i(t)},e.exports.isImageBitmap=function(t){return"[object ImageBitmap]"===i(t)},e.exports.limiter=function(t){var e=0,r=[];function i(){e<t&&r.length&&(e++,r.shift()())}return function(t){return new Promise((function(n,A){r.push((function(){t().then((function(t){n(t),e--,i()}),(function(t){A(t),e--,i()}))})),i()}))}},e.exports.cib_quality_name=function(t){switch(t){case 0:return"pixelated";case 1:return"low";case 2:return"medium"}return"high"},e.exports.cib_support=function(t){return Promise.resolve().then((function(){if("undefined"==typeof createImageBitmap)return!1;var e=t(100,100);return createImageBitmap(e,0,0,100,100,{resizeWidth:10,resizeHeight:10,resizeQuality:"high"}).then((function(t){var r=10===t.width;return t.close(),e=null,r}))})).catch((function(){return!1}))},e.exports.worker_offscreen_canvas_support=function(){return new Promise((function(t,e){if("undefined"!=typeof OffscreenCanvas){var r=btoa("(".concat(function(t){"undefined"!=typeof createImageBitmap?Promise.resolve().then((function(){var t=new OffscreenCanvas(10,10);return t.getContext("2d").rect(0,0,1,1),createImageBitmap(t,0,0,1,1)})).then((function(){return t.postMessage(!0)}),(function(){return t.postMessage(!1)})):t.postMessage(!1)}.toString(),")(self);")),i=new Worker("data:text/javascript;base64,".concat(r));i.onmessage=function(e){return t(e.data)},i.onerror=e}else t(!1)})).then((function(t){return t}),(function(){return!1}))},e.exports.can_use_canvas=function(t){var e=!1;try{var r=t(2,1).getContext("2d"),i=r.createImageData(2,1);i.data[0]=12,i.data[1]=23,i.data[2]=34,i.data[3]=255,i.data[4]=45,i.data[5]=56,i.data[6]=67,i.data[7]=255,r.putImageData(i,0,0),i=null,12===(i=r.getImageData(0,0,2,1)).data[0]&&23===i.data[1]&&34===i.data[2]&&255===i.data[3]&&45===i.data[4]&&56===i.data[5]&&67===i.data[6]&&255===i.data[7]&&(e=!0)}catch(t){}return e},e.exports.cib_can_use_region=function(){return new Promise((function(t){if("undefined"!=typeof createImageBitmap){var e=new Image;e.src="data:image/jpeg;base64,/9j/4QBiRXhpZgAATU0AKgAAAAgABQESAAMAAAABAAYAAAEaAAUAAAABAAAASgEbAAUAAAABAAAAUgEoAAMAAAABAAIAAAITAAMAAAABAAEAAAAAAAAAAABIAAAAAQAAAEgAAAAB/9sAQwAEAwMEAwMEBAMEBQQEBQYKBwYGBgYNCQoICg8NEBAPDQ8OERMYFBESFxIODxUcFRcZGRsbGxAUHR8dGh8YGhsa/9sAQwEEBQUGBQYMBwcMGhEPERoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoa/8IAEQgAAQACAwERAAIRAQMRAf/EABQAAQAAAAAAAAAAAAAAAAAAAAf/xAAUAQEAAAAAAAAAAAAAAAAAAAAA/9oADAMBAAIQAxAAAAF/P//EABQQAQAAAAAAAAAAAAAAAAAAAAD/2gAIAQEAAQUCf//EABQRAQAAAAAAAAAAAAAAAAAAAAD/2gAIAQMBAT8Bf//EABQRAQAAAAAAAAAAAAAAAAAAAAD/2gAIAQIBAT8Bf//EABQQAQAAAAAAAAAAAAAAAAAAAAD/2gAIAQEABj8Cf//EABQQAQAAAAAAAAAAAAAAAAAAAAD/2gAIAQEAAT8hf//aAAwDAQACAAMAAAAQH//EABQRAQAAAAAAAAAAAAAAAAAAAAD/2gAIAQMBAT8Qf//EABQRAQAAAAAAAAAAAAAAAAAAAAD/2gAIAQIBAT8Qf//EABQQAQAAAAAAAAAAAAAAAAAAAAD/2gAIAQEAAT8Qf//Z",e.onload=function(){createImageBitmap(e,0,0,e.width,e.height).then((function(r){r.width===e.width&&r.height===e.height?t(!0):t(!1)}),(function(){return t(!1)}))},e.onerror=function(){return t(!1)}}else t(!1)}))}},{}],17:[function(t,e,r){"use strict";e.exports=function(){var e,r=t("./mathlib");onmessage=function(t){var i=t.data.opts;if(!i.src&&i.srcBitmap){var n=new OffscreenCanvas(i.width,i.height),A=n.getContext("2d",{alpha:Boolean(i.alpha)});A.drawImage(i.srcBitmap,0,0),i.src=A.getImageData(0,0,i.width,i.height).data,n.width=n.height=0,n=null,i.srcBitmap.close(),i.srcBitmap=null}e||(e=new r(t.data.features));var a=e.resizeAndUnsharp(i);postMessage({data:a},[a.buffer])}}},{"./mathlib":1}],18:[function(t,e,r){var i,n,A,a,o,s;function u(t,e,r,i,n,A){var a,o,s,u,h,c,f,l,g,d,p,m,I,w;for(g=0;g<A;g++){for(f=g,l=0,u=h=(a=t[c=g*n])*i[6],p=i[0],m=i[1],I=i[4],w=i[5],d=0;d<n;d++)s=(o=t[c])*p+a*m+u*I+h*w,h=u,u=s,a=o,r[l]=u,l++,c++;for(l--,f+=A*(n-1),u=h=(a=t[--c])*i[7],o=a,p=i[2],m=i[3],d=n-1;d>=0;d--)s=o*p+a*m+u*I+h*w,h=u,u=s,a=o,o=t[c],e[f]=r[l]+u,c--,l--,f-=A}}e.exports=function(t,e,r,h){if(h){var c=new Uint16Array(t.length),f=new Float32Array(Math.max(e,r)),l=function(t){t<.5&&(t=.5);var e=Math.exp(.527076)/t,r=Math.exp(-e),u=Math.exp(-2*e),h=(1-r)*(1-r)/(1+2*e*r-u);return i=h,n=h*(e-1)*r,A=h*(e+1)*r,a=-h*u,o=2*r,s=-u,new Float32Array([i,n,A,a,o,s,(i+n)/(1-o-s),(A+a)/(1-o-s)])}(h);u(t,c,f,l,e,r),u(c,t,f,l,r,e)}}},{}],19:[function(t,e,r){"function"==typeof Object.create?e.exports=function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(t,e){if(e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}}},{}],20:[function(t,e,r){"use strict";var i=t("object-assign"),n=t("./lib/base64decode"),A=t("./lib/wa_detect"),a={js:!0,wasm:!0};function o(t){if(!(this instanceof o))return new o(t);var e=i({},a,t||{});if(this.options=e,this.__cache={},this.__init_promise=null,this.__modules=e.modules||{},this.__memory=null,this.__wasm={},this.__isLE=1===new Uint32Array(new Uint8Array([1,0,0,0]).buffer)[0],!this.options.js&&!this.options.wasm)throw new Error('mathlib: at least "js" or "wasm" should be enabled')}o.prototype.has_wasm=A,o.prototype.use=function(t){return this.__modules[t.name]=t,this.options.wasm&&this.has_wasm()&&t.wasm_fn?this[t.name]=t.wasm_fn:this[t.name]=t.fn,this},o.prototype.init=function(){if(this.__init_promise)return this.__init_promise;if(!this.options.js&&this.options.wasm&&!this.has_wasm())return Promise.reject(new Error('mathlib: only "wasm" was enabled, but it\'s not supported'));var t=this;return this.__init_promise=Promise.all(Object.keys(t.__modules).map((function(e){var r=t.__modules[e];return t.options.wasm&&t.has_wasm()&&r.wasm_fn?t.__wasm[e]?null:WebAssembly.compile(t.__base64decode(r.wasm_src)).then((function(r){t.__wasm[e]=r})):null}))).then((function(){return t})),this.__init_promise},o.prototype.__base64decode=n,o.prototype.__reallocate=function(t){if(!this.__memory)return this.__memory=new WebAssembly.Memory({initial:Math.ceil(t/65536)}),this.__memory;var e=this.__memory.buffer.byteLength;return e<t&&this.__memory.grow(Math.ceil((t-e)/65536)),this.__memory},o.prototype.__instance=function(t,e,r){if(e&&this.__reallocate(e),!this.__wasm[t]){var n=this.__modules[t];this.__wasm[t]=new WebAssembly.Module(this.__base64decode(n.wasm_src))}if(!this.__cache[t]){var A={memoryBase:0,memory:this.__memory,tableBase:0,table:new WebAssembly.Table({initial:0,element:"anyfunc"})};this.__cache[t]=new WebAssembly.Instance(this.__wasm[t],{env:i(A,r||{})})}return this.__cache[t]},o.prototype.__align=function(t,e){var r=t%(e=e||8);return t+(r?e-r:0)},e.exports=o},{"./lib/base64decode":21,"./lib/wa_detect":22,"object-assign":23}],21:[function(t,e,r){"use strict";e.exports=function(t){for(var e=t.replace(/[\r\n=]/g,""),r=e.length,i=new Uint8Array(3*r>>2),n=0,A=0,a=0;a<r;a++)a%4==0&&a&&(i[A++]=n>>16&255,i[A++]=n>>8&255,i[A++]=255&n),n=n<<6|"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(e.charAt(a));var o=r%4*6;return 0===o?(i[A++]=n>>16&255,i[A++]=n>>8&255,i[A++]=255&n):18===o?(i[A++]=n>>10&255,i[A++]=n>>2&255):12===o&&(i[A++]=n>>4&255),i}},{}],22:[function(t,e,r){"use strict";var i;e.exports=function(){if(void 0!==i)return i;if(i=!1,"undefined"==typeof WebAssembly)return i;try{var t=new Uint8Array([0,97,115,109,1,0,0,0,1,6,1,96,1,127,1,127,3,2,1,0,5,3,1,0,1,7,8,1,4,116,101,115,116,0,0,10,16,1,14,0,32,0,65,1,54,2,0,32,0,40,2,0,11]),e=new WebAssembly.Module(t);return 0!==new WebAssembly.Instance(e,{}).exports.test(4)&&(i=!0),i}catch(t){}return i}},{}],23:[function(t,e,r){
|
|
8
8
|
/*
|
|
9
9
|
object-assign
|
|
10
10
|
(c) Sindre Sorhus
|
package/lib/worker.js
CHANGED
|
@@ -21,7 +21,9 @@ module.exports = function () {
|
|
|
21
21
|
canvas = null;
|
|
22
22
|
tileOpts.srcBitmap.close();
|
|
23
23
|
tileOpts.srcBitmap = null;
|
|
24
|
-
|
|
24
|
+
// Temporary force out data to typed array, because Chrome have artefacts
|
|
25
|
+
// https://github.com/nodeca/pica/issues/223
|
|
26
|
+
// returnBitmap = true;
|
|
25
27
|
}
|
|
26
28
|
|
|
27
29
|
if (!mathLib) mathLib = new MathLib(ev.data.features);
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pica",
|
|
3
3
|
"description": "High quality image resize in browser.",
|
|
4
|
-
"version": "7.1.
|
|
4
|
+
"version": "7.1.1",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"resize",
|
|
7
7
|
"scale",
|
|
@@ -40,15 +40,15 @@
|
|
|
40
40
|
"@babel/preset-env": "^7.1.0",
|
|
41
41
|
"babelify": "^10.0.0",
|
|
42
42
|
"benchmark": "^2.1.0",
|
|
43
|
-
"browserify": "^
|
|
43
|
+
"browserify": "^17.0.0",
|
|
44
44
|
"browserify-header": "^1.0.1",
|
|
45
45
|
"derequire": "^2.1.0",
|
|
46
46
|
"electron": "^12.0.9",
|
|
47
47
|
"electron-mocha": "^10.0.0",
|
|
48
|
-
"eslint": "^
|
|
48
|
+
"eslint": "^8.3.0",
|
|
49
49
|
"gh-pages": "^3.1.0",
|
|
50
|
-
"mocha": "^
|
|
50
|
+
"mocha": "^9.1.3",
|
|
51
51
|
"pixelmatch": "^5.0.2",
|
|
52
|
-
"terser": "^
|
|
52
|
+
"terser": "^5.10.0"
|
|
53
53
|
}
|
|
54
54
|
}
|
package/CHANGELOG.md
DELETED
|
@@ -1,345 +0,0 @@
|
|
|
1
|
-
# Changelog
|
|
2
|
-
|
|
3
|
-
All notable changes to this project will be documented in this file.
|
|
4
|
-
|
|
5
|
-
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
|
-
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
## [7.1.0] - 2021-06-21
|
|
10
|
-
### Changed
|
|
11
|
-
- In FireFox experimental resist fingerprinting mode `pica.resize()` now returns an error
|
|
12
|
-
instead of returning random data, nodeca/image-blob-reduce#28.
|
|
13
|
-
|
|
14
|
-
### Fixed
|
|
15
|
-
- Images with Exif orientation are now resized correctly in Chromium-based browsers
|
|
16
|
-
(it was previously broken in pica 7.0.0), #211.
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
## [7.0.0] - 2021-05-23
|
|
20
|
-
### Changed
|
|
21
|
-
- [BREAKING] Rewrite unsharp mask, use `V` channel of HSV instead of `L` channel
|
|
22
|
-
of HSL, to reduce color shift (#209).
|
|
23
|
-
- [BREAKING] Unsharp mask options are now more close to Photoshop (`unsharpAmount`
|
|
24
|
-
should be multiplied by 2 and `unsharpThreshold` should be divided by 2
|
|
25
|
-
if you switch from v6.x).
|
|
26
|
-
- Splitted big `Pica` methods to smaller ones.
|
|
27
|
-
- Use docker to build webassembly modules.
|
|
28
|
-
|
|
29
|
-
### Added
|
|
30
|
-
- Use `OffscreenCanvas` when possible (extract image bitmap in webworker).
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
## [6.1.1] - 2020-08-20
|
|
34
|
-
### Fixed
|
|
35
|
-
- Aded Safari canvas GC workaround, #199.
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
## [6.1.0] - 2020-07-10
|
|
39
|
-
### Added
|
|
40
|
-
- Aded OffscreenCanvas support, #195.
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
## [6.0.0] - 2020-06-25
|
|
44
|
-
### Changed
|
|
45
|
-
- Use `dist/pica.js` as main entry. No more workarounds needed for webpack.
|
|
46
|
-
- Avoid babelify dependency in dependent packages if browserify used.
|
|
47
|
-
- Rewrite build scripts.
|
|
48
|
-
|
|
49
|
-
### Added
|
|
50
|
-
- Added `ImageBitmap` input support.
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
## [5.3.0] - 2020-06-09
|
|
54
|
-
### Changed
|
|
55
|
-
- Use `derequire` to allow nested `browserify` for `/dist/pica.js`.
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
## [5.2.0] - 2020-05-25
|
|
59
|
-
### Added
|
|
60
|
-
- Aded OffscreenCanvas support, #195.
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
## [5.1.1] - 2020-05-18
|
|
64
|
-
### Fixed
|
|
65
|
-
- Suppress `createImageBitmap` errors to use fallback, #190.
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
## [5.1.0] - 2019-07-15
|
|
69
|
-
### Changed
|
|
70
|
-
- Bump multimath dependency.
|
|
71
|
-
|
|
72
|
-
### Fixed
|
|
73
|
-
- Avoid possible CSP warnings, caused by WASM check, when feature not requested
|
|
74
|
-
in options.
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
## [5.0.1] - 2019-07-12
|
|
78
|
-
### Fixed
|
|
79
|
-
- Fix unsharp crash when CIB enabled (from 4.0.0), #160.
|
|
80
|
-
|
|
81
|
-
### Changed
|
|
82
|
-
- Dev deps bump.
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
## [5.0.0] - 2018-11-02
|
|
86
|
-
### Changed
|
|
87
|
-
- Maintenance, babelify upgrade: switch to @babel/core and @babel/preset-env.
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
## [4.2.0] - 2018-10-25
|
|
91
|
-
### Fixed
|
|
92
|
-
- Added bounds check for invalid output canvas size (#155).
|
|
93
|
-
|
|
94
|
-
### Changed
|
|
95
|
-
- Maintenance: dev deps bump.
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
## [4.1.1] - 2018-03-31
|
|
99
|
-
### Changed
|
|
100
|
-
- Should return result via promise (regression), fix #139.
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
## [4.1.0] - 2018-03-27
|
|
104
|
-
### Changed
|
|
105
|
-
- Resize in multiple steps for big scales, fix #135.
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
## [4.0.2] - 2018-03-05
|
|
109
|
-
### Fixed
|
|
110
|
-
- Multimath bump, should fix issue with broken WebAssembly engine in IOS 11.2.x
|
|
111
|
-
Webkit (Safary/Chrome).
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
## [4.0.1] - 2017-10-13
|
|
115
|
-
### Fixed
|
|
116
|
-
- Attempt to fix failure when WebAssembly disabled via CSP.
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
## [4.0.0] - 2017-09-30
|
|
120
|
-
### Changed
|
|
121
|
-
- Internals rewritten to use `multimath` library.
|
|
122
|
-
- WebAssembly implementation for `unsharp mask`, as bonus.
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
## [3.0.6] - 2017-07-13
|
|
126
|
-
### Fixed
|
|
127
|
-
- More constrains for `createImageBitmap()` use. Filter out browsers
|
|
128
|
-
without `ImageBitmap.prototype.close()` method (Chrome 51 etc).
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
## [3.0.5] - 2017-06-30
|
|
132
|
-
### Fixed
|
|
133
|
-
- Avoid Promise use in webworker. Should help with IE11, which suddently
|
|
134
|
-
fixed creating of webworkers from data URI.
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
## [3.0.4] - 2017-04-20
|
|
138
|
-
### Fixed
|
|
139
|
-
- IE fix.
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
## [3.0.3] - 2017-04-18
|
|
143
|
-
### Fixed
|
|
144
|
-
- Fixed non working `.createImageBitmap()` resize, but disabled
|
|
145
|
-
by default due bad quality.
|
|
146
|
-
|
|
147
|
-
### Added
|
|
148
|
-
- Added debug messages.
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
## [3.0.2] - 2017-04-16
|
|
152
|
-
### Fixed
|
|
153
|
-
- Fix wasm crash on upscale, #87.
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
## [3.0.1] - 2017-04-14
|
|
157
|
-
### Fixed
|
|
158
|
-
- Add missed `.set()` fallback for ancient browsers.
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
## [3.0.0] - 2017-04-11
|
|
162
|
-
### Added
|
|
163
|
-
- Add WebAssembly resizer.
|
|
164
|
-
- Add createImageBitmap() resizer.
|
|
165
|
-
- Add .toBlob() method.
|
|
166
|
-
|
|
167
|
-
### Changed
|
|
168
|
-
- Major rewrite. New API, promise-based.
|
|
169
|
-
- Add async image decode via createImageBitmap().
|
|
170
|
-
|
|
171
|
-
### Removed
|
|
172
|
-
- Drop WebGL resizer.
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
## [2.0.8] - 2016-10-01
|
|
176
|
-
### Changed
|
|
177
|
-
- Set default number of CPUs (workers) to 1 if `navigator.hardwareConcurrency`
|
|
178
|
-
not supported (ancient browsers).
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
## [2.0.7] - 2016-10-01
|
|
182
|
-
### Fixed
|
|
183
|
-
- Fix Safary bug (grid could appear on downscaled image).
|
|
184
|
-
|
|
185
|
-
### Changed
|
|
186
|
-
- WEBGL shaders rework (still buggy, not for production).
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
## [2.0.6] - 2016-08-04
|
|
190
|
-
### Fixed
|
|
191
|
-
- Fix tiler math: bad rounding could produce tiles out of src area, #61.
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
## [2.0.5] - 2016-07-19
|
|
195
|
-
### Fixed
|
|
196
|
-
- Fix mem leak: release objectURL, used to create Web Workers.
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
## [2.0.4] - 2016-06-24
|
|
200
|
-
### Changed
|
|
201
|
-
- Deps bump (`webworkify`). Previous version had problems with IE Edge, #56.
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
## [2.0.3] - 2016-06-07
|
|
205
|
-
### Changed
|
|
206
|
-
- Deps bump. Use fresh `webworkify` with proper ObjectURL release, #55.
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
## [2.0.2] - 2016-03-30
|
|
210
|
-
### Changed
|
|
211
|
-
- Optimised previous fix.
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
## [2.0.1] - 2016-03-30
|
|
215
|
-
### Fixed
|
|
216
|
-
- Fixed garbage on image edge tiles when alpha exists.
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
## [2.0.0] - 2016-03-12
|
|
220
|
-
### Added
|
|
221
|
-
- Support `Image()` as input src.
|
|
222
|
-
|
|
223
|
-
### Changed
|
|
224
|
-
- Architecture rework: images are now splitted to tiles to restrict memory use
|
|
225
|
-
and allow parallel processing.
|
|
226
|
-
- Built-in WebWorkers manager to use all available CPU cores.
|
|
227
|
-
- Feature flags (WW, WEBGL) are forced to `false` after resize call,
|
|
228
|
-
if feature not supported or disabled due fatal error.
|
|
229
|
-
- `unsharpRadius` range restricted to 0.5..2.0.
|
|
230
|
-
- Experimental code for WebGL support (noisy & buggy, disabled by default).
|
|
231
|
-
- `.resizeBuffer()` is no longer recommended for use. It does not use webworkers
|
|
232
|
-
anymore (and option `transferable` is not used too).
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
## [1.1.1] - 2015-11-10
|
|
236
|
-
### Changed
|
|
237
|
-
- Bumped `glur` version to fix bug in unsharp mask with vertical images.
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
## [1.1.0] - 2015-11-09
|
|
241
|
-
### Changed
|
|
242
|
-
- Unsharp mask now useable.
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
## [1.0.8] - 2015-10-28
|
|
246
|
-
### Fixed
|
|
247
|
-
- Fixed brightness loss due missed value rounding in convolvers.
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
## [1.0.7] - 2014-11-18
|
|
251
|
-
### Fixed
|
|
252
|
-
- Fixed alpha reset for images without alpha channel (regression in 1.0.5).
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
## [1.0.6] - 2014-11-08
|
|
256
|
-
### Changed
|
|
257
|
-
- Removed alpha correction, because canvas data is not premultipled (#13).
|
|
258
|
-
Thanks to @devongovett.
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
## [1.0.5] - 2014-11-03
|
|
262
|
-
### Changed
|
|
263
|
-
- Expose WebWorker on pica call, to allow early termination of task.
|
|
264
|
-
- Minor speed opts.
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
## [1.0.4] - 2014-10-04
|
|
268
|
-
### Added
|
|
269
|
-
- Added transferable objects support.
|
|
270
|
-
|
|
271
|
-
### Fixed
|
|
272
|
-
- Fixed demo to fork over ssl too.
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
## [1.0.3] - 2014-09-29
|
|
276
|
-
### Added
|
|
277
|
-
- Added unsharp mask implementation (very naive). Need futher work.
|
|
278
|
-
|
|
279
|
-
### Changed
|
|
280
|
-
- ~25% speed boost (thanks to @mraleph for advice).
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
## [1.0.2] - 2014-09-27
|
|
284
|
-
### Fixed
|
|
285
|
-
- Improved capabilities detection.
|
|
286
|
-
- `.WW` now shows if pica can use Web Workers or not.
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
## [1.0.1] - 2014-09-25
|
|
290
|
-
### Added
|
|
291
|
-
- Enchanced API to allow pass destination buffer by reference.
|
|
292
|
-
|
|
293
|
-
### Fixed
|
|
294
|
-
- Added IE workarounds. Thanks to @noomorph.
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
## [1.0.0] - 2014-09-24
|
|
298
|
-
### Changed
|
|
299
|
-
- First release.
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
[7.1.0]: https://github.com/nodeca/pica/compare/7.0.0...7.1.0
|
|
303
|
-
[7.0.0]: https://github.com/nodeca/pica/compare/6.1.1...7.0.0
|
|
304
|
-
[6.1.1]: https://github.com/nodeca/pica/compare/6.1.0...6.1.1
|
|
305
|
-
[6.1.0]: https://github.com/nodeca/pica/compare/6.0.0...6.1.0
|
|
306
|
-
[6.0.0]: https://github.com/nodeca/pica/compare/5.3.0...6.0.0
|
|
307
|
-
[5.3.0]: https://github.com/nodeca/pica/compare/5.2.0...5.3.0
|
|
308
|
-
[5.2.0]: https://github.com/nodeca/pica/compare/5.1.1...5.2.0
|
|
309
|
-
[5.1.1]: https://github.com/nodeca/pica/compare/5.1.0...5.1.1
|
|
310
|
-
[5.1.0]: https://github.com/nodeca/pica/compare/5.0.1...5.1.0
|
|
311
|
-
[5.0.1]: https://github.com/nodeca/pica/compare/5.0.0...5.0.1
|
|
312
|
-
[5.0.0]: https://github.com/nodeca/pica/compare/4.2.0...5.0.0
|
|
313
|
-
[4.2.0]: https://github.com/nodeca/pica/compare/4.1.1...4.2.0
|
|
314
|
-
[4.1.1]: https://github.com/nodeca/pica/compare/4.1.0...4.1.1
|
|
315
|
-
[4.1.0]: https://github.com/nodeca/pica/compare/4.0.2...4.1.0
|
|
316
|
-
[4.0.2]: https://github.com/nodeca/pica/compare/4.0.1...4.0.2
|
|
317
|
-
[4.0.1]: https://github.com/nodeca/pica/compare/4.0.0...4.0.1
|
|
318
|
-
[4.0.0]: https://github.com/nodeca/pica/compare/3.0.6...4.0.0
|
|
319
|
-
[3.0.6]: https://github.com/nodeca/pica/compare/3.0.5...3.0.6
|
|
320
|
-
[3.0.5]: https://github.com/nodeca/pica/compare/3.0.4...3.0.5
|
|
321
|
-
[3.0.4]: https://github.com/nodeca/pica/compare/3.0.3...3.0.4
|
|
322
|
-
[3.0.3]: https://github.com/nodeca/pica/compare/3.0.2...3.0.3
|
|
323
|
-
[3.0.2]: https://github.com/nodeca/pica/compare/3.0.1...3.0.2
|
|
324
|
-
[3.0.1]: https://github.com/nodeca/pica/compare/3.0.0...3.0.1
|
|
325
|
-
[3.0.0]: https://github.com/nodeca/pica/compare/2.0.8...3.0.0
|
|
326
|
-
[2.0.8]: https://github.com/nodeca/pica/compare/2.0.7...2.0.8
|
|
327
|
-
[2.0.7]: https://github.com/nodeca/pica/compare/2.0.6...2.0.7
|
|
328
|
-
[2.0.6]: https://github.com/nodeca/pica/compare/2.0.5...2.0.6
|
|
329
|
-
[2.0.5]: https://github.com/nodeca/pica/compare/2.0.4...2.0.5
|
|
330
|
-
[2.0.4]: https://github.com/nodeca/pica/compare/2.0.3...2.0.4
|
|
331
|
-
[2.0.3]: https://github.com/nodeca/pica/compare/2.0.2...2.0.3
|
|
332
|
-
[2.0.2]: https://github.com/nodeca/pica/compare/2.0.1...2.0.2
|
|
333
|
-
[2.0.1]: https://github.com/nodeca/pica/compare/2.0.0...2.0.1
|
|
334
|
-
[2.0.0]: https://github.com/nodeca/pica/compare/1.1.1...2.0.0
|
|
335
|
-
[1.1.1]: https://github.com/nodeca/pica/compare/1.1.0...1.1.1
|
|
336
|
-
[1.1.0]: https://github.com/nodeca/pica/compare/1.0.8...1.1.0
|
|
337
|
-
[1.0.8]: https://github.com/nodeca/pica/compare/1.0.7...1.0.8
|
|
338
|
-
[1.0.7]: https://github.com/nodeca/pica/compare/1.0.6...1.0.7
|
|
339
|
-
[1.0.6]: https://github.com/nodeca/pica/compare/1.0.5...1.0.6
|
|
340
|
-
[1.0.5]: https://github.com/nodeca/pica/compare/1.0.4...1.0.5
|
|
341
|
-
[1.0.4]: https://github.com/nodeca/pica/compare/1.0.3...1.0.4
|
|
342
|
-
[1.0.3]: https://github.com/nodeca/pica/compare/1.0.2...1.0.3
|
|
343
|
-
[1.0.2]: https://github.com/nodeca/pica/compare/1.0.1...1.0.2
|
|
344
|
-
[1.0.1]: https://github.com/nodeca/pica/compare/1.0.0...1.0.1
|
|
345
|
-
[1.0.0]: https://github.com/nodeca/pica/releases/tag/1.0.0
|