From 9bf444e93a32e6db3ca0db829b67c6764f18b406 Mon Sep 17 00:00:00 2001 From: Dessalines Date: Fri, 5 Jun 2020 11:45:04 -0400 Subject: [PATCH] Removing webp for now. --- ui/src/utils.ts | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/ui/src/utils.ts b/ui/src/utils.ts index cb56ba581..961584627 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'); - - 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 + // TODO pictshare might have a webp conversion bug, try disabling this 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; }