summaryrefslogtreecommitdiff
path: root/src/services
diff options
context:
space:
mode:
authorsyuilo <Syuilotan@yahoo.co.jp>2019-07-04 14:45:28 +0900
committersyuilo <Syuilotan@yahoo.co.jp>2019-07-04 14:45:28 +0900
commitead5a6a258261f2294aad770ccc1ff01d02ed832 (patch)
tree1e641fbb3616019ae0d8d94541e0aa42d53e749b /src/services
parentFix MIME (diff)
downloadsharkey-ead5a6a258261f2294aad770ccc1ff01d02ed832.tar.gz
sharkey-ead5a6a258261f2294aad770ccc1ff01d02ed832.tar.bz2
sharkey-ead5a6a258261f2294aad770ccc1ff01d02ed832.zip
APNG support
Diffstat (limited to 'src/services')
-rw-r--r--src/services/drive/add-file.ts6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/services/drive/add-file.ts b/src/services/drive/add-file.ts
index a2143ca608..e7b1e2a812 100644
--- a/src/services/drive/add-file.ts
+++ b/src/services/drive/add-file.ts
@@ -46,6 +46,8 @@ async function save(file: DriveFile, path: string, name: string, type: string, h
if (type === 'image/jpeg') ext = '.jpg';
if (type === 'image/png') ext = '.png';
if (type === 'image/webp') ext = '.webp';
+ if (type === 'image/apng') ext = '.apng';
+ if (type === 'image/vnd.mozilla.apng') ext = '.apng';
}
const baseUrl = meta.objectStorageBaseUrl
@@ -181,6 +183,8 @@ export async function generateAlts(path: string, type: string, generateWeb: bool
thumbnail = await convertToPng(path, 498, 280);
} else if (['image/gif'].includes(type)) {
thumbnail = await convertToGif(path);
+ } else if (['image/apng', 'image/vnd.mozilla.apng'].includes(type)) {
+ thumbnail = await convertToApng(path);
} else if (type.startsWith('video/')) {
try {
thumbnail = await GenerateVideoThumbnail(path);
@@ -356,7 +360,7 @@ export default async function(
let propPromises: Promise<void>[] = [];
- const isImage = ['image/jpeg', 'image/gif', 'image/png', 'image/webp'].includes(mime);
+ const isImage = ['image/jpeg', 'image/gif', 'image/png', 'image/apng', 'image/vnd.mozilla.apng', 'image/webp'].includes(mime);
if (isImage) {
const img = sharp(path);