diff --git a/src/index.ts b/src/index.ts index 48a375e..4ab6963 100644 --- a/src/index.ts +++ b/src/index.ts @@ -388,10 +388,10 @@ export class KoaResponsiveImageRouter extends Router { }; const extensions = [ - ...(imageParams.lossless ? [] : ["jxl", "avif"]), + ...(imageParams.lossless ? [] : ["avif"]), "webp", "png", - ...(imageParams.lossless ? [] : ["jpg"]), + ...(imageParams.lossless ? [] : ["jpeg"]), ]; let imageWidth = imgDimensions.width; diff --git a/src/types/imageRouter.ts b/src/types/imageRouter.ts index 79f073b..68e97b3 100644 --- a/src/types/imageRouter.ts +++ b/src/types/imageRouter.ts @@ -45,7 +45,7 @@ export type Task = { crop: SmartCropOptions | DirectCropOptions | undefined; }; -export type correctExtension = "jpeg" | "png" | "avif" | "webp" | "jxl"; +export type correctExtension = "jpeg" | "png" | "avif" | "webp"; export type ImageData = { resolutions: number[]; diff --git a/src/utils/utils.ts b/src/utils/utils.ts index 0c5f472..27f2cc7 100644 --- a/src/utils/utils.ts +++ b/src/utils/utils.ts @@ -5,7 +5,7 @@ import os from "os"; export function isCorrectExtension( fileExtension: unknown ): fileExtension is correctExtension { - const extensions = ["avif", "webp", "jpeg", "png", "jxl"]; + const extensions = ["avif", "webp", "jpeg", "png"]; return extensions.includes(fileExtension as string); }