mirror of
https://github.com/9001/copyparty.git
synced 2025-08-18 01:22:13 -06:00
persist webp test result
This commit is contained in:
parent
ed8fff8c52
commit
71b478e6e2
|
@ -268,14 +268,19 @@ function goto(dest) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
var have_webp = null;
|
var have_webp = sread('have_webp');
|
||||||
(function () {
|
(function () {
|
||||||
|
if (have_webp !== null)
|
||||||
|
return;
|
||||||
|
|
||||||
var img = new Image();
|
var img = new Image();
|
||||||
img.onload = function () {
|
img.onload = function () {
|
||||||
have_webp = img.width > 0 && img.height > 0;
|
have_webp = img.width > 0 && img.height > 0;
|
||||||
|
swrite('have_webp', 'ya');
|
||||||
};
|
};
|
||||||
img.onerror = function () {
|
img.onerror = function () {
|
||||||
have_webp = false;
|
have_webp = false;
|
||||||
|
swrite('have_webp', '');
|
||||||
};
|
};
|
||||||
img.src = "data:image/webp;base64,UklGRhoAAABXRUJQVlA4TA0AAAAvAAAAEAcQERGIiP4HAA==";
|
img.src = "data:image/webp;base64,UklGRhoAAABXRUJQVlA4TA0AAAAvAAAAEAcQERGIiP4HAA==";
|
||||||
})();
|
})();
|
||||||
|
|
Loading…
Reference in a new issue