fix: optimize thumbnail image urls

This commit is contained in:
Xylight committed 2024-02-24 10:00:44 -08:00
1 parent 62044ce3b7
commit 8b82a782f5
4 files changed
+21 -9

No files matched your search

@@ -21,7 +21,7 @@
VideoCamera,
type IconSource,
} from 'svelte-hero-icons'
import type { IframeType, MediaType } from '../helpers'
import { optimizeImageURL, type IframeType, type MediaType } from '../helpers'
import { userSettings } from '$lib/settings'
export let type: IframeType = 'none'
@@ -102,7 +102,7 @@
>
{#if thumbnail}
<img
src={thumbnail}
src={optimizeImageURL(thumbnail, 512)}
class="absolute top-0 left-0 -z-10 brightness-[25%] w-full object-cover h-full"
alt=""
/>
@@ -11,17 +11,13 @@
showImage,
} from '$lib/components/ui/ExpandableImage.svelte'
import { userSettings } from '$lib/settings.js'
import { isImage, isVideo } from '$lib/ui/image'
import type { Post } from 'lemmy-js-client'
import { Icon, VideoCamera } from 'svelte-hero-icons'
import PostIframe from './PostIframe.svelte'
export let view: 'card' | 'cozy' | 'list' | 'compact' = 'cozy'
export let post: Post
export let type: MediaType = 'none'
export let opened: boolean | undefined = undefined
console.log
</script>
{#if type == 'image'}