mirror of
https://github.com/LemmyNet/lemmy.git
synced 2024-11-25 15:39:11 +00:00
Removing webp for now.
This commit is contained in:
parent
7c0ea6cfa7
commit
9bf444e93a
25
ui/src/utils.ts
vendored
25
ui/src/utils.ts
vendored
|
@ -863,16 +863,19 @@ export function previewLines(text: string, lines: number = 3): string {
|
||||||
}
|
}
|
||||||
|
|
||||||
function canUseWebP() {
|
function canUseWebP() {
|
||||||
var elem = document.createElement('canvas');
|
// TODO pictshare might have a webp conversion bug, try disabling this
|
||||||
|
|
||||||
if (!!(elem.getContext && elem.getContext('2d'))) {
|
|
||||||
var testString = !(window.mozInnerScreenX == null) ? 'png' : 'webp';
|
|
||||||
// was able or not to get WebP representation
|
|
||||||
return (
|
|
||||||
elem.toDataURL('image/webp').startsWith('data:image/' + testString)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
// very old browser like IE 8, canvas not supported
|
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
// var elem = document.createElement('canvas');
|
||||||
|
|
||||||
|
// if (!!(elem.getContext && elem.getContext('2d'))) {
|
||||||
|
// var testString = !(window.mozInnerScreenX == null) ? 'png' : 'webp';
|
||||||
|
// // was able or not to get WebP representation
|
||||||
|
// return (
|
||||||
|
// elem.toDataURL('image/webp').startsWith('data:image/' + testString)
|
||||||
|
// );
|
||||||
|
// }
|
||||||
|
|
||||||
|
// // very old browser like IE 8, canvas not supported
|
||||||
|
// return false;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue