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.
This commit is contained in:
gloamxun committed 2026-10-27 23:30:26 +08:00
1 parent 16dd2e1f62
commit d00402a745
1 file changed
+2 -2
+2 -2
View File
@@ -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 {