Server IP : 80.87.202.40 / Your IP : 216.73.216.169 Web Server : Apache System : Linux rospirotorg.ru 5.14.0-539.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Dec 5 22:26:13 UTC 2024 x86_64 User : bitrix ( 600) PHP Version : 8.2.27 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /home/bitrix/ext_www/rospirotorg.ru/bitrix/js/landing/compressor/ |
Upload File : |
(function(){"use strict";BX.namespace("BX.Landing");var i={quality:.8};var t=BX.Landing.Utils.urlToBlob;var n=BX.Landing.Utils.fileSize;var e=BX.Landing.Utils.isPlainObject;var o=BX.Landing.Utils.isNumber;BX.Landing.ImageCompressor=function(t,n){this.file=t;this.options=Object.assign({},i,s(n)||{});if(this.options.retina){void(o(this.options.width)&&(this.options.width*=2));void(o(this.options.height)&&(this.options.height*=2));void(o(this.options.maxWidth)&&(this.options.maxWidth*=2));void(o(this.options.maxHeight)&&(this.options.maxHeight*=2));void(o(this.options.minWidth)&&(this.options.minWidth*=2));void(o(this.options.minHeight)&&(this.options.minHeight*=2))}};function s(i){i=e(i)?i:{};return Object.keys(i).reduce(function(t,n){return typeof i[n]!=="undefined"&&(t[n]=i[n]),t},{})}function r(i){var t=n(i.before);var e=n(i.after);var o=i.quality;var s=i.retina?"@2x":"";console.info("Image compressed",t,"�>",e,"(quality "+o*100+"%)",s)}BX.Landing.ImageCompressor.compress=function(i,n){return t(i).then(function(i){var t=new BX.Landing.ImageCompressor(i,n);return t.compress().then(function(n){r({before:i.size,after:n.size,quality:t.options.quality,retina:t.options.retina});return n})})};BX.Landing.ImageCompressor.test=function(i,e){var o={before:0,after:0,printable:{before:"0 B",after:"0 B"}};return t(i).then(function(i){return new BX.Landing.ImageCompressor(i,e).compress().then(function(t){o.before=i.size;o.after=t.size;o.printable.before=n(i.size);o.printable.after=n(t.size);return o})})};BX.Landing.ImageCompressor.prototype={compress:function(){var i=this.file;var t=this.options;return new Promise(function(n,e){void new Compressor(i,Object.assign({},t,{success:n,error:e}))})}}})(); //# sourceMappingURL=compressor.map.js