Changeset 1c33804 in Klonkt
- Timestamp:
- 06/30/2026 06:02:20 PM (2 months ago)
- Branches:
- main
- Children:
- adb6291
- Parents:
- 7ecbefc
- File:
-
- 1 edited
-
src/services/VideoCoverService.js (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
src/services/VideoCoverService.js
r7ecbefc r1c33804 40 40 } 41 41 const data = Buffer.from(await img.getFrameData(i)); // fr.width*fr.height*4 RGBA sub-region 42 const fx = fr.x, fy = fr.y, fw = fr.width, fh = fr.height, blend = fr.blend; 42 // node-webpmux returns the raw ANMF offset, which the WebP spec stores as actual/2 (frame 43 // offsets are always even); libwebp/webpmux double it. So ×2 the x/y to get the true pixel 44 // position — else partial frames land at half-offset and ghost over the base. width/height are fine. 45 const fx = fr.x * 2, fy = fr.y * 2, fw = fr.width, fh = fr.height, blend = fr.blend; 43 46 if (fx === 0 && fy === 0 && fw === W && fh === H && !blend) { 44 47 data.copy(canvas, 0); // full opaque overwrite (the typical base frame)
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)