Memory leak fixes

This commit is contained in:
Roman Krček
2025-07-30 16:36:06 +02:00
parent 1aa6cd53fa
commit 923300e49b
7 changed files with 213 additions and 86 deletions

View File

@@ -6,6 +6,7 @@ import {
TEXT_FIELD_LAYOUT,
PHOTO_FIELD_LAYOUT
} from './pdfSettings';
import { get } from 'idb-keyval';
// Conversion factor from millimeters to points (1 inch = 72 points, 1 inch = 25.4 mm)
export const MM_TO_PT = 72 / 25.4;
@@ -17,6 +18,11 @@ export interface GridLayout {
cellHeight: number; // mm
}
// Function to retrieve a blob from IndexedDB
export async function getImageBlob(url: string): Promise<Blob | undefined> {
return await get(url);
}
// Calculate how many cards can fit on a page.
export function calculateGrid(
pageWidth: number,