New attachment storage system
This commit is contained in:
parent
273e1ccb15
commit
28664a606f
161 changed files with 2418 additions and 1562 deletions
|
@ -6,6 +6,10 @@ import { AvatarColorMap } from '../types/Colors';
|
|||
import type { AvatarDataType } from '../types/Avatar';
|
||||
import { canvasToBytes } from './canvasToBytes';
|
||||
import { getFittedFontSize } from './avatarTextSizeCalculator';
|
||||
import {
|
||||
getLocalAttachmentUrl,
|
||||
AttachmentDisposition,
|
||||
} from './getLocalAttachmentUrl';
|
||||
|
||||
const CANVAS_SIZE = 1024;
|
||||
|
||||
|
@ -93,9 +97,17 @@ export async function avatarDataToBytes(
|
|||
|
||||
if (imagePath) {
|
||||
await drawImage(
|
||||
window.Signal?.Migrations
|
||||
? window.Signal.Migrations.getAbsoluteAvatarPath(imagePath)
|
||||
: imagePath,
|
||||
getLocalAttachmentUrl(
|
||||
{
|
||||
...avatarData,
|
||||
|
||||
// Slight incompatibility
|
||||
path: imagePath,
|
||||
},
|
||||
{
|
||||
disposition: AttachmentDisposition.AvatarData,
|
||||
}
|
||||
),
|
||||
context,
|
||||
canvas
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue