diff --git a/ui/component/fileThumbnail/view.jsx b/ui/component/fileThumbnail/view.jsx index c1b88b1b1..d5f5a3e12 100644 --- a/ui/component/fileThumbnail/view.jsx +++ b/ui/component/fileThumbnail/view.jsx @@ -6,6 +6,10 @@ import FreezeframeWrapper from './FreezeframeWrapper'; import Placeholder from './placeholder.png'; import classnames from 'classnames'; +const THUMBNAIL_HEIGHT = 180; +const THUMBNAIL_WIDTH = 320; +const THUMBNAIL_QUALITY = 100; + type Props = { uri: string, thumbnail: ?string, // externally sourced image @@ -42,12 +46,10 @@ function FileThumbnail(props: Props) { // @if TARGET='web' // Pass image urls through a compression proxy if (thumbnail && THUMBNAIL_CDN_URL && !thumbnail.includes('https://spee.ch')) { - // url = `${THUMBNAIL_CDN_URL}${thumbnail}&quality=75&height=288&width=512`; + url = `${THUMBNAIL_CDN_URL}${thumbnail}&quality=${THUMBNAIL_QUALITY}&height=${THUMBNAIL_HEIGHT}&width=${THUMBNAIL_WIDTH}`; + } else if (thumbnail && thumbnail.includes('https://spee.ch')) { + url = `${url}?quality=${THUMBNAIL_QUALITY}&height=${THUMBNAIL_HEIGHT}&width=${THUMBNAIL_WIDTH}`; } - - // else if (thumbnail && thumbnail.includes('https://spee.ch')) { - // url = `${url}?height=512&width=288`; - // } // @endif return (