Skip to content

Commit

Permalink
Temporarily let more image requests through
Browse files Browse the repository at this point in the history
  • Loading branch information
slmnio committed Nov 8, 2022
1 parent 61c9069 commit bdede3d
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions server/src/images.js
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ module.exports = ({ app, cors, Cache, corsHandle }) => {
};
}

if (["svg", "gif"].includes(originalFileType)) {
if (!size /*["svg", "gif"].includes(originalFileType)*/) { // TODO: load image first then detect filetype
// just do orig if svg
size = "orig";
}
Expand All @@ -205,7 +205,11 @@ module.exports = ({ app, cors, Cache, corsHandle }) => {

let imagePath = await getImage(filename, size);

if (imagePath) return res.sendFile(imagePath);
if (imagePath) {
// let metaFileType = (await sharp(imagePath).metadata())?.format;
// console.log({metaFileType});
return res.sendFile(imagePath);
}
console.log("[image]", `no file for ${originalFilename} @ ${size}`);
// no image

Expand All @@ -222,6 +226,9 @@ module.exports = ({ app, cors, Cache, corsHandle }) => {
if (size === "orig") return res.sendFile(orig);
}

// let metaFileType = (await sharp(orig).metadata())?.format;
// console.log({metaFileType});

// resize time!
// console.log("[image]", `resizing ${originalFilename} @ ${size}`);
const t = Date.now();
Expand Down

0 comments on commit bdede3d

Please sign in to comment.