Two small ones in DocxSemanticBackend, both found while reviewing #525 and neither worth its
own change alone.
The image is decoded twice per export. writeImage calls
NodeDefinitionSupport.toImageData(node.imageData()) for the intrinsic size, and then
resolveImageDimensions calls it again internally. Only the metadata decode is cached:
ImageSourceCache.fromBytes does an Arrays.copyOf plus a SHA-256 over the whole array on
every call, so a 10 MB image costs two full copies and two hashes. A path-sourced image also
logs ImageData.create(Path)'s INFO line twice. The fix is an overload of
resolveImageDimensions that accepts an already-resolved ImageData.
A row cell loses its paragraph alignment. writeParagraph carries
para.setAlignment(toAlignment(node.align())); writeRowCellChild does not, so a centred
paragraph inside a row cell exports left-aligned. One line, and the asymmetry is not
deliberate.
Two small ones in
DocxSemanticBackend, both found while reviewing #525 and neither worth itsown change alone.
The image is decoded twice per export.
writeImagecallsNodeDefinitionSupport.toImageData(node.imageData())for the intrinsic size, and thenresolveImageDimensionscalls it again internally. Only the metadata decode is cached:ImageSourceCache.fromBytesdoes anArrays.copyOfplus a SHA-256 over the whole array onevery call, so a 10 MB image costs two full copies and two hashes. A path-sourced image also
logs
ImageData.create(Path)'s INFO line twice. The fix is an overload ofresolveImageDimensionsthat accepts an already-resolvedImageData.A row cell loses its paragraph alignment.
writeParagraphcarriespara.setAlignment(toAlignment(node.align()));writeRowCellChilddoes not, so a centredparagraph inside a
rowcell exports left-aligned. One line, and the asymmetry is notdeliberate.