perf(thumbs): switch thumbnail encoding from WebP to JPEG q=80

Replace all 3 ImageFormat::WebP encode sites with JpegEncoder q=80.
Update fast-path to detect JPEG SOI instead of RIFF/WEBP magic.
Change file extension .webp -> .jpg, Content-Type headers, and
browser toBlob. Remove unused ImageFormat import and stale comments.
The webp feature stays for DECODING uploaded WebP images.
This commit is contained in:
Diocrafts
2026-03-07 20:37:19 +01:00
parent 05108d3e12
commit b8638f5131
4 changed files with 37 additions and 32 deletions
+3 -3
View File
@@ -268,9 +268,9 @@ const photosView = {
const ctx = canvas.getContext('2d');
ctx.drawImage(video, 0, 0, canvas.width, canvas.height);
// Try WebP first, fall back to JPEG
const mimeType = typeof canvas.toBlob === 'function'
? 'image/webp' : 'image/jpeg';
// JPEG: explicit quality control, universally supported,
// and server stores as-is when dimensions fit (zero re-encode).
const mimeType = 'image/jpeg';
canvas.toBlob((blob) => {
if (!blob) {