Changeset 8f6225c in Klonkt for src/routes/account.js


Ignore:
Timestamp:
06/20/2026 01:57:35 AM (3 months ago)
Author:
roboburr <roboburr@…>
Branches:
main
Children:
85d5972
Parents:
fa08981
Message:

feat(images): new uploads automatically converted to WebP

Shared ImageWebpService.toWebp() converts uploaded images via cwebp (q82)
and removes the original; cwebp absent/error → original preserved (graceful).
Wired up in all upload routes: post images/cover, avatar, site photo, hub
hero, audio cover. GIF stays GIF, already-webp skipped.

Co-Authored-By: Claude <noreply@…>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/routes/account.js

    rfa08981 r8f6225c  
    2525import { requireAuth } from '../middleware/auth.js';
    2626import { googleConfigured } from '../config/google.js';
     27import { toWebp } from '../services/ImageWebpService.js';
    2728
    2829const __dirname = path.dirname(fileURLToPath(import.meta.url));
     
    190191    }
    191192
    192     const url = `/media/avatars/${req.file.filename}`;
     193    const url = `/media/avatars/${toWebp(req.file)}`;
    193194
    194195    // Remove the old avatar file (if it lives in our avatar dir)
Note: See TracChangeset for help on using the changeset viewer.