Fix typo of quality argument in image compression
The quality value should be a float in the range 0.0 to 1.0. Other values (e.g. 50) are discarded silently and a default is used. Fixes #713 // FREEBIE
This commit is contained in:
parent
544a346b10
commit
e874b61839
1 changed files with 2 additions and 2 deletions
|
@ -101,8 +101,8 @@
|
||||||
canvas.toDataURL('image/jpeg', quality)
|
canvas.toDataURL('image/jpeg', quality)
|
||||||
);
|
);
|
||||||
quality = quality * maxSize / blob.size;
|
quality = quality * maxSize / blob.size;
|
||||||
if (quality < 50) {
|
if (quality < 0.5) {
|
||||||
quality = 50;
|
quality = 0.5;
|
||||||
}
|
}
|
||||||
} while (i > 0 && blob.size > maxSize);
|
} while (i > 0 && blob.size > maxSize);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue