From a4ef474cabc4113c3dca72bf08bc477c452c624c Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Wed, 26 Aug 2026 22:53:30 -0400 Subject: image digest: single read, cache file read & hash For image digests cache file read & hash, one read per image file Fix issue: images referenced from several objects were read and hashed once per reference. [as an example in the sisu-manual sm_tux.png accounts for 6 of the document's image records (12 across the sample set), each of them a fresh read of the same bytes, and source_pod.d hashes the file again for digests.txt.] Memoise on the full path within safeComputeHashAndSize. static is thread-local in D, so documents processed in parallel each get their own cache and no synchronisation is involved. Files are not expected to change during a run. Output is unchanged: identical .ssp output. (An image that is missing or unreadable now warns once to stdout rather than once per reference). (assisted by Claude-Code) --- src/sisudoc/ocda/abstraction/ssp.d | 1 - 1 file changed, 1 deletion(-) (limited to 'src/sisudoc/ocda/abstraction') diff --git a/src/sisudoc/ocda/abstraction/ssp.d b/src/sisudoc/ocda/abstraction/ssp.d index 25cc467..1d1ea22 100644 --- a/src/sisudoc/ocda/abstraction/ssp.d +++ b/src/sisudoc/ocda/abstraction/ssp.d @@ -300,7 +300,6 @@ template spineAbstractionTxt() { ? ".image: " ~ i.fileName ~ " missing:true" : ".image: " ~ i.fileName - ~ " sha256:" ~ i.fileHash_sha256.toHexString.to!string ~ " sha256:" ~ i.fileHash_sha256.toHexString.to!string ~ " bytes:" ~ i.fileSize.to!string ~ ((i.imageWidth > 0 && i.imageHeight > 0) -- cgit v1.2.3