Changeset 8f6225c in Klonkt for src/routes/admin-sites.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/admin-sites.js

    rfa08981 r8f6225c  
    2525import ThemeService from '../services/ThemeService.js';
    2626import { listPlatforms, PLATFORMS } from '../services/PlatformIcons.js';
     27import { toWebp } from '../services/ImageWebpService.js';
    2728
    2829const __dirname = path.dirname(fileURLToPath(import.meta.url));
     
    8889    res.json({
    8990      ok: true,
    90       url: `/media/avatars/${req.file.filename}`,
     91      url: `/media/avatars/${toWebp(req.file)}`,
    9192      size: req.file.size,
    9293      mime: req.file.mimetype,
Note: See TracChangeset for help on using the changeset viewer.