fix(po): size XLSX export images by pixels (aspect preserved) #60
No reviewers
Labels
No labels
bug
claude-failed
claude-pr
claude-queue
claude-working
feature
interactive
portal
triaged
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: shad0w/pelagia-portal#60
Loading…
Add table
Reference in a new issue
No description provided.
Delete branch "fix/xlsx-export-asset-sizing"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Fixes the XLSX export where the logo, signature, stamp, and CANCELLED watermark were sized/stretched incorrectly (the PDF was already fine).
Cause
Those images were placed with ExcelJS two-cell (
tl/br) anchors, which stretch an image to fill a cell range — so aspect ratios were distorted, and the watermark (which has transparent margins) only filled the centre of its box, looking small and squished. The PDF looks right because CSS sizes by aspect (object-fit: contain/ fixed text size).Fix
lib/image-size.ts:getImageSize(PNG/JPEG/WebP header parse, no deps) +scaleToBox(fit within a px box, aspect preserved).tl+ pixelext, sized to match the PDF: logo ≤96×52, signature ≤165×44, stamp ≤80×66, watermark ≤880×720.Verification
oneCellAnchors with fixed pixel sizes — 49×52 / 45×44 / 67×66 / 880×629 — aspect preserved, no cell-range stretching.getImageSize+scaleToBox.pnpm testgreen (199), type-check clean.🤖 Generated with Claude Code
Reference issue #53