mirror of
https://gitlab.com/soapbox-pub/ditto.git
synced 2025-12-06 11:29:46 +00:00
Expose thumb and image to Attachment view, don't set thumb (since it's redundant with image)
This commit is contained in:
parent
6774975051
commit
d70a00a8ca
2 changed files with 3 additions and 5 deletions
|
|
@ -89,10 +89,6 @@ export async function uploadFile(
|
||||||
tags.push(['image', url]);
|
tags.push(['image', url]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!thumb) {
|
|
||||||
tags.push(['thumb', url]);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!blurhash || !dim) {
|
if (!blurhash || !dim) {
|
||||||
try {
|
try {
|
||||||
const img = sharp(bytes);
|
const img = sharp(bytes);
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,8 @@ function renderAttachment(
|
||||||
const alt = tags.find(([name]) => name === 'alt')?.[1];
|
const alt = tags.find(([name]) => name === 'alt')?.[1];
|
||||||
const cid = tags.find(([name]) => name === 'cid')?.[1];
|
const cid = tags.find(([name]) => name === 'cid')?.[1];
|
||||||
const dim = tags.find(([name]) => name === 'dim')?.[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];
|
const blurhash = tags.find(([name]) => name === 'blurhash')?.[1];
|
||||||
|
|
||||||
if (!url) return;
|
if (!url) return;
|
||||||
|
|
@ -34,7 +36,7 @@ function renderAttachment(
|
||||||
id: id ?? url,
|
id: id ?? url,
|
||||||
type: getAttachmentType(m ?? ''),
|
type: getAttachmentType(m ?? ''),
|
||||||
url,
|
url,
|
||||||
preview_url: url,
|
preview_url: image ?? thumb ?? url,
|
||||||
remote_url: null,
|
remote_url: null,
|
||||||
description: alt ?? '',
|
description: alt ?? '',
|
||||||
blurhash: blurhash || null,
|
blurhash: blurhash || null,
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue