fix: disable image optimizations for logo to prevent caching issues with custom logos

This commit is contained in:
Elias Schneider
2023-10-09 10:40:55 +02:00
parent f15a8dc277
commit 38919003e9
4 changed files with 6 additions and 6 deletions

View File

@@ -7,7 +7,8 @@ const IMAGES_PATH = "../frontend/public/img";
@Injectable()
export class LogoService {
async create(file: Buffer) {
fs.writeFileSync(`${IMAGES_PATH}/logo.png`, file, "binary");
const resized = await sharp(file).resize(900).toBuffer();
fs.writeFileSync(`${IMAGES_PATH}/logo.png`, resized, "binary");
this.createFavicon(file);
this.createPWAIcons(file);
}
@@ -25,7 +26,7 @@ export class LogoService {
fs.promises.writeFile(
`${IMAGES_PATH}/icons/icon-${size}x${size}.png`,
resized,
"binary",
"binary"
);
}
}