Drag & drop photos here, or browse
-
JPEG · PNG · HEIC · WebP — max 10 MB each
+
JPEG · PNG · WebP — max 10 MB each
diff --git a/main-site/index.html b/main-site/index.html
index 1aa1c8c..48790e7 100644
--- a/main-site/index.html
+++ b/main-site/index.html
@@ -208,7 +208,7 @@
Drag & drop photos here, or browse
-
JPEG · PNG · HEIC · WebP — max 10 MB each
+
JPEG · PNG · WebP — max 10 MB each
diff --git a/main-site/server.js b/main-site/server.js
index 13f982c..f0ef88e 100644
--- a/main-site/server.js
+++ b/main-site/server.js
@@ -174,9 +174,13 @@ apiRouter.post('/contact', upload.array('photos', 3), async (req, res) => {
const attachments = [];
for (const file of (req.files || [])) {
- const webpBuffer = await sharp(file.buffer).webp({ quality: 85 }).toBuffer();
- const baseName = path.parse(file.originalname).name;
- attachments.push({ filename: `${baseName}.webp`, content: webpBuffer, contentType: 'image/webp' });
+ try {
+ const webpBuffer = await sharp(file.buffer).webp({ quality: 85 }).toBuffer();
+ const baseName = path.parse(file.originalname).name;
+ attachments.push({ filename: `${baseName}.webp`, content: webpBuffer, contentType: 'image/webp' });
+ } catch (err) {
+ console.warn(`[${new Date().toISOString()}] Skipping unsupported image ${file.originalname}: ${err.message}`);
+ }
}
function formatDate(str) {