mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-13 01:00:12 +00:00
Implement media resizing using Discord media cache (#470)
* Implement media resizing using Discord media cache Improve performance by offloading image scaling to Discord Only apply the resizing to images stored in the Discord CDN Set the format of the resized images to WebP for improved performance * Implemented suggestion for improved regex
This commit is contained in:
parent
7aa4d49a97
commit
adaddb579e
5 changed files with 29 additions and 6 deletions
|
|
@ -4,6 +4,7 @@
|
|||
import moment from 'moment';
|
||||
import { toHTML } from 'discord-markdown';
|
||||
import parseTimestamps from '../../api/parse-timestamps';
|
||||
import resizeMedia from '../../api/resize-media';
|
||||
import Edit from './Edit.svelte';
|
||||
import twemoji from 'twemoji';
|
||||
import Privacy from './Privacy.svelte';
|
||||
|
|
@ -124,7 +125,7 @@
|
|||
{@html htmlDescription && htmlDescription}
|
||||
</div>
|
||||
{#if (group.banner && ((settings && settings.appearance.banner_bottom) || !settings))}
|
||||
<img src={group.banner} alt="group banner" class="w-100 mb-3 rounded" style="max-height: 12em; object-fit: cover"/>
|
||||
<img src={resizeMedia(group.banner, [1200, 480])} alt="group banner" class="w-100 mb-3 rounded" style="max-height: 13em; object-fit: cover"/>
|
||||
{/if}
|
||||
|
||||
{#if !isPublic}
|
||||
|
|
@ -165,4 +166,4 @@
|
|||
margin-left: 0.25em;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue