Changeset 5bc67b4 in Klonkt for src/services/ThumbnailService.js


Ignore:
Timestamp:
06/28/2026 09:20:04 PM (2 months ago)
Author:
Robin Genis <roboburr@…>
Branches:
main
Children:
abc8959
Parents:
492fc20
Message:

fix(images): 96px feed/comment/follow avatars (2x of the 44px display)

A 128px avatar thumbnail shown at 44px = ~2.9x browser downscale → still jagged for
line-art. Serve the small fediverse avatars at 96px (~2.2x, the same crisp ratio as the grid).

  • services/ThumbnailService.js — add 96 to the size whitelist
  • views/pages/news.ejs, partials/fedi-node.ejs, pages/following.ejs — avatar(..., 96)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/services/ThumbnailService.js

    r492fc20 r5bc67b4  
    2323const execFileP = promisify(execFile);
    2424
    25 // Allowed widths (whitelist → no arbitrary-size abuse). 128 = avatars; 256 ≈ 2× a list
    26 // cover; 480 ≈ 2× a grid tile. Keep these ~2× the display size so line-art stays crisp.
    27 export const THUMB_SIZES = new Set([128, 256, 320, 480, 640]);
     25// Allowed widths (whitelist → no arbitrary-size abuse). 96 = small feed/comment avatars
     26// (~44px); 128 = nav/profile avatars; 256 ≈ 2× a list cover; 480 ≈ 2× a grid tile. Keep
     27// these ~2× the display size so line-art stays crisp (the browser barely downscales).
     28export const THUMB_SIZES = new Set([96, 128, 256, 320, 480, 640]);
    2829
    2930let _seq = 0;
Note: See TracChangeset for help on using the changeset viewer.