Expose thumb and image to Attachment view, don't set thumb (since it's redundant with image)

This commit is contained in:
Alex Gleason 2025-02-28 10:51:08 -06:00
parent 6774975051
commit d70a00a8ca
No known key found for this signature in database
GPG key ID: 7211D1F99744FBB7
2 changed files with 3 additions and 5 deletions

View file

@ -89,10 +89,6 @@ export async function uploadFile(
tags.push(['image', url]);
}
if (!thumb) {
tags.push(['thumb', url]);
}
if (!blurhash || !dim) {
try {
const img = sharp(bytes);

View file

@ -14,6 +14,8 @@ function renderAttachment(
const alt = tags.find(([name]) => name === 'alt')?.[1];
const cid = tags.find(([name]) => name === 'cid')?.[1];
const dim = tags.find(([name]) => name === 'dim')?.[1];
const image = tags.find(([key]) => key === 'image')?.[1];
const thumb = tags.find(([key]) => key === 'thumb')?.[1];
const blurhash = tags.find(([name]) => name === 'blurhash')?.[1];
if (!url) return;
@ -34,7 +36,7 @@ function renderAttachment(
id: id ?? url,
type: getAttachmentType(m ?? ''),
url,
preview_url: url,
preview_url: image ?? thumb ?? url,
remote_url: null,
description: alt ?? '',
blurhash: blurhash || null,