enable thumbnail cdn for all file thumbnails

This commit is contained in:
Sean Yesmunt 2020-12-11 15:47:06 -05:00
parent 05d625484d
commit a5e9557e4b

View file

@ -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 (