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:
2-4601 2016-04-09 14:57:52 +03:00 committed by lilia
parent 544a346b10
commit e874b61839

View file

@ -101,8 +101,8 @@
canvas.toDataURL('image/jpeg', quality)
);
quality = quality * maxSize / blob.size;
if (quality < 50) {
quality = 50;
if (quality < 0.5) {
quality = 0.5;
}
} while (i > 0 && blob.size > maxSize);