From d00402a7457864bb46373f569c85130c28d01dba Mon Sep 17 00:00:00 2001 From: GloamXun Date: Tue, 27 Oct 2026 23:30:26 +0800 Subject: [PATCH] Use pixel dimensions for PDF image XObjects The display-list conversion stored the layout width/height (scaled points) as PdfImage.width/height, so an image XObject claimed 12 million pixels and pdfimages reported bad image parameters; the image never appeared. Keep the layout rectangle in DisplayItem::Image but use the raster pixel dimensions for the XObject. Verified pdfimages now lists the 480x240 plot and the article PDF shows it. Test count stays 1074. --- crates/texrra-tex-core/src/render.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/texrra-tex-core/src/render.rs b/crates/texrra-tex-core/src/render.rs index 1f54734..338186e 100755 --- a/crates/texrra-tex-core/src/render.rs +++ b/crates/texrra-tex-core/src/render.rs @@ -622,8 +622,8 @@ impl Page { image, } => { let index = list.add_image(PdfImage { - width: (*width).max(0) as u32, - height: (*height).max(0) as u32, + width: image.width, + height: image.height, rgb: image.rgb.clone(), }); list.push(DisplayItem::Image {