brainloper-ui 20.0.13 → 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.
@@ -3149,7 +3149,7 @@ class FileInputComponent {
3149
3149
  accept;
3150
3150
  fileControl;
3151
3151
  maxSize = 16;
3152
- size = 100000; //tamaño a comprimir las imagenes en bites
3152
+ size = 500000; //tamaño objetivo a comprimir las imagenes en bytes
3153
3153
  fileName = '';
3154
3154
  params;
3155
3155
  fileSave = new EventEmitter();
@@ -3289,6 +3289,7 @@ class FileInputComponent {
3289
3289
  if (this.file.size > 500000 && this.file.size < 15000000) {
3290
3290
  let factor = (this.size * 100) / this.file.size;
3291
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%
3292
3293
  return new Promise((resolve, reject) => {
3293
3294
  new Compressor(this.file, {
3294
3295
  quality: y,