diff options
| author | syuilo <Syuilotan@yahoo.co.jp> | 2023-03-12 20:57:04 +0900 |
|---|---|---|
| committer | syuilo <Syuilotan@yahoo.co.jp> | 2023-03-12 20:57:04 +0900 |
| commit | 7e9d3d9b2f28f363952c8d2d45d929e2c6bfea5c (patch) | |
| tree | 6f2c02c7affb95f39875600a4845a867b264c01e /packages/backend/src/server | |
| parent | refactor(test): rename variable for INestApplicationContext (diff) | |
| parent | fix: Do not use avif (#10301) (diff) | |
| download | sharkey-7e9d3d9b2f28f363952c8d2d45d929e2c6bfea5c.tar.gz sharkey-7e9d3d9b2f28f363952c8d2d45d929e2c6bfea5c.tar.bz2 sharkey-7e9d3d9b2f28f363952c8d2d45d929e2c6bfea5c.zip | |
Merge branch 'develop' of https://github.com/misskey-dev/misskey into develop
Diffstat (limited to 'packages/backend/src/server')
| -rw-r--r-- | packages/backend/src/server/FileServerService.ts | 10 | ||||
| -rw-r--r-- | packages/backend/src/server/web/UrlPreviewService.ts | 2 |
2 files changed, 6 insertions, 6 deletions
diff --git a/packages/backend/src/server/FileServerService.ts b/packages/backend/src/server/FileServerService.ts index fb1c67f20d..794fa76d9e 100644 --- a/packages/backend/src/server/FileServerService.ts +++ b/packages/backend/src/server/FileServerService.ts @@ -130,7 +130,7 @@ export class FileServerService { if (isMimeImage(file.mime, 'sharp-convertible-image-with-bmp')) { reply.header('Cache-Control', 'max-age=31536000, immutable'); - const url = new URL(`${this.config.mediaProxy}/static.avif`); + const url = new URL(`${this.config.mediaProxy}/static.webp`); url.searchParams.set('url', file.url); url.searchParams.set('static', '1'); @@ -151,7 +151,7 @@ export class FileServerService { if (['image/svg+xml'].includes(file.mime)) { reply.header('Cache-Control', 'max-age=31536000, immutable'); - const url = new URL(`${this.config.mediaProxy}/svg.avif`); + const url = new URL(`${this.config.mediaProxy}/svg.webp`); url.searchParams.set('url', file.url); file.cleanup(); @@ -291,9 +291,9 @@ export class FileServerService { }; } } else if ('static' in request.query) { - image = this.imageProcessingService.convertSharpToAvifStream(await sharpBmp(file.path, file.mime), 498, 422); + image = this.imageProcessingService.convertSharpToWebpStream(await sharpBmp(file.path, file.mime), 498, 422); } else if ('preview' in request.query) { - image = this.imageProcessingService.convertSharpToAvifStream(await sharpBmp(file.path, file.mime), 200, 200); + image = this.imageProcessingService.convertSharpToWebpStream(await sharpBmp(file.path, file.mime), 200, 200); } else if ('badge' in request.query) { const mask = (await sharpBmp(file.path, file.mime)) .resize(96, 96, { @@ -325,7 +325,7 @@ export class FileServerService { type: 'image/png', }; } else if (file.mime === 'image/svg+xml') { - image = this.imageProcessingService.convertToAvifStream(file.path, 2048, 2048); + image = this.imageProcessingService.convertToWebpStream(file.path, 2048, 2048); } else if (!file.mime.startsWith('image/') || !FILE_TYPE_BROWSERSAFE.includes(file.mime)) { throw new StatusError('Rejected type', 403, 'Rejected type'); } diff --git a/packages/backend/src/server/web/UrlPreviewService.ts b/packages/backend/src/server/web/UrlPreviewService.ts index 5f4d53d0ec..2ce7293a52 100644 --- a/packages/backend/src/server/web/UrlPreviewService.ts +++ b/packages/backend/src/server/web/UrlPreviewService.ts @@ -33,7 +33,7 @@ export class UrlPreviewService { private wrap(url?: string | null): string | null { return url != null ? url.match(/^https?:\/\//) - ? `${this.config.mediaProxy}/preview.avif?${query({ + ? `${this.config.mediaProxy}/preview.webp?${query({ url, preview: '1', })}` |