From: Dessalines Date: Fri, 5 Jun 2020 15:45:04 +0000 (-0400) Subject: Removing webp for now. X-Git-Url: http://these/git/%7B%60%24%7BwebArchiveUrl%7D/%22%7B%7D/%22https:/nerdica.net/static/%7BpictshareAvatarThumbnail%28?a=commitdiff_plain;h=9bf444e93a32e6db3ca0db829b67c6764f18b406;p=lemmy.git Removing webp for now. --- diff --git a/ui/src/utils.ts b/ui/src/utils.ts index cb56ba58..96158462 100644 --- a/ui/src/utils.ts +++ b/ui/src/utils.ts @@ -863,16 +863,19 @@ export function previewLines(text: string, lines: number = 3): string { } function canUseWebP() { - var elem = document.createElement('canvas'); + // TODO pictshare might have a webp conversion bug, try disabling this + return false; - 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) - ); - } + // var elem = document.createElement('canvas'); - // very old browser like IE 8, canvas not supported - return false; + // 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; }