fix(cover): round page count to even before computing spine width
Amazon rounds odd page counts up to the next even number before calculating spine thickness. 99 pages → 100 effective pages gives 0.2347 in (5.96 mm) instead of 0.2324 in (5.90 mm). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Binary file not shown.
+3
-2
@@ -90,8 +90,9 @@ async function generate() {
|
|||||||
console.warn('Run `pnpm build` first for an accurate spine width.\n');
|
console.warn('Run `pnpm build` first for an accurate spine width.\n');
|
||||||
}
|
}
|
||||||
|
|
||||||
// Compute dimensions
|
// Amazon rounds odd page counts up to even before computing spine width
|
||||||
const spineWidth = pageCount * SPINE_PER_PAGE;
|
const effectivePageCount = pageCount % 2 === 0 ? pageCount : pageCount + 1;
|
||||||
|
const spineWidth = effectivePageCount * SPINE_PER_PAGE;
|
||||||
const totalWidth = BLEED_IN + TRIM_W_IN + spineWidth + TRIM_W_IN + BLEED_IN;
|
const totalWidth = BLEED_IN + TRIM_W_IN + spineWidth + TRIM_W_IN + BLEED_IN;
|
||||||
const totalHeight = BLEED_IN + TRIM_H_IN + BLEED_IN;
|
const totalHeight = BLEED_IN + TRIM_H_IN + BLEED_IN;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user