diff --git a/routes/imageRoutes.js b/routes/imageRoutes.js index e6e1967..755bf1f 100644 --- a/routes/imageRoutes.js +++ b/routes/imageRoutes.js @@ -183,12 +183,13 @@ router.get('/preview/:projectId/:orderId', async (req, res) => { // Obtenir les dimensions originales de l'image const metadata = await sharp(imagePath).metadata(); - const width = Math.floor(metadata.width / 5); - const height = Math.floor(metadata.height / 5); + const width = Math.floor(metadata.width / 7); + const height = Math.floor(metadata.height / 7); // Redimensionner l'image à la moitié de ses dimensions d'origine const resizedImage = await sharp(imagePath) .resize(width, height) + .jpeg({ quality: 65 }) .toBuffer(); res.set('Content-Type', 'image/jpeg');