Make JPEG Output quality user controllable (#607)

Add a slider to the image options for the JPEG quality
For PNG images, the slider is hidden.
This commit is contained in:
JeLuF
2022-12-05 06:32:33 +01:00
committed by GitHub
parent 7861c57317
commit e7ca8090fd
7 changed files with 72 additions and 10 deletions

View File

@ -347,6 +347,16 @@ function asyncDelay(timeout) {
})
}
/* Simple debounce function, placeholder for the one in engine.js for simple use cases */
function debounce(func, timeout = 300){
let timer;
return (...args) => {
clearTimeout(timer);
timer = setTimeout(() => { func.apply(this, args); }, timeout);
};
}
function preventNonNumericalInput(e) {
e = e || window.event;
let charCode = (typeof e.which == "undefined") ? e.keyCode : e.which;