brainloper-ui 20.0.12 → 20.0.14
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.
|
@@ -1788,8 +1788,12 @@ class TemplateFuelComponent {
|
|
|
1788
1788
|
return doc;
|
|
1789
1789
|
})
|
|
1790
1790
|
.then((docResult) => {
|
|
1791
|
-
|
|
1792
|
-
|
|
1791
|
+
const blob = docResult.output('blob');
|
|
1792
|
+
const blobUrl = URL.createObjectURL(blob);
|
|
1793
|
+
const newWindow = window.open(blobUrl, '_blank');
|
|
1794
|
+
if (newWindow) {
|
|
1795
|
+
newWindow.onload = () => URL.revokeObjectURL(blobUrl);
|
|
1796
|
+
}
|
|
1793
1797
|
this.dialog.closeAll();
|
|
1794
1798
|
this.message.closeLoading();
|
|
1795
1799
|
});
|
|
@@ -3145,7 +3149,7 @@ class FileInputComponent {
|
|
|
3145
3149
|
accept;
|
|
3146
3150
|
fileControl;
|
|
3147
3151
|
maxSize = 16;
|
|
3148
|
-
size =
|
|
3152
|
+
size = 500000; //tamaño objetivo a comprimir las imagenes en bytes
|
|
3149
3153
|
fileName = '';
|
|
3150
3154
|
params;
|
|
3151
3155
|
fileSave = new EventEmitter();
|
|
@@ -3285,6 +3289,7 @@ class FileInputComponent {
|
|
|
3285
3289
|
if (this.file.size > 500000 && this.file.size < 15000000) {
|
|
3286
3290
|
let factor = (this.size * 100) / this.file.size;
|
|
3287
3291
|
let y = ((factor ** 3) * (10 ** -6)) - (0.00059 * (factor ** 2)) + (0.0399 * factor);
|
|
3292
|
+
y = Math.min(Math.max(y, 0.5), 1); // calidad mínima 50%, máxima 100%
|
|
3288
3293
|
return new Promise((resolve, reject) => {
|
|
3289
3294
|
new Compressor(this.file, {
|
|
3290
3295
|
quality: y,
|