fix: Extensions should be converted to lowercase
This commit is contained in:
parent
3917818c76
commit
1dfc7c443b
1 changed files with 9 additions and 9 deletions
|
@ -16,17 +16,17 @@ import * as path from "node:path";
|
||||||
const logger = queueLogger.createSubLogger("import-custom-emojis");
|
const logger = queueLogger.createSubLogger("import-custom-emojis");
|
||||||
|
|
||||||
// probeImageSize acceptable extensions
|
// probeImageSize acceptable extensions
|
||||||
|
// JPG, GIF, PNG, WebP, BMP, TIFF, SVG, PSD.
|
||||||
const acceptableExtensions = [
|
const acceptableExtensions = [
|
||||||
".avif",
|
|
||||||
".bmp",
|
|
||||||
".gif",
|
|
||||||
".ico",
|
|
||||||
".jpeg",
|
".jpeg",
|
||||||
|
".jpg",
|
||||||
|
".gif",
|
||||||
".png",
|
".png",
|
||||||
".psd",
|
|
||||||
// ".svg", // Disable for secure issues
|
|
||||||
".tiff",
|
|
||||||
".webp",
|
".webp",
|
||||||
|
".bmp",
|
||||||
|
".tiff",
|
||||||
|
// ".svg", // Disable for secure issues
|
||||||
|
".psd",
|
||||||
];
|
];
|
||||||
|
|
||||||
// TODO: 名前衝突時の動作を選べるようにする
|
// TODO: 名前衝突時の動作を選べるようにする
|
||||||
|
@ -80,7 +80,7 @@ export async function importCustomEmojis(
|
||||||
const extname = path.extname(record.fileName);
|
const extname = path.extname(record.fileName);
|
||||||
|
|
||||||
// Skip non-support files
|
// Skip non-support files
|
||||||
if (!acceptableExtensions.includes(extname)) {
|
if (!acceptableExtensions.includes(extname.toLowerCase())) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -128,7 +128,7 @@ export async function importCustomEmojis(
|
||||||
const extname = path.extname(emojiFilename);
|
const extname = path.extname(emojiFilename);
|
||||||
|
|
||||||
// Skip non-emoji files, such as LICENSE
|
// Skip non-emoji files, such as LICENSE
|
||||||
if (!acceptableExtensions.includes(extname)) {
|
if (!acceptableExtensions.includes(extname.toLowerCase())) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue