ppt-binary: check the PowerPoint 95 crop's right and bottom values

A sample cropped on the right and at the bottom shows the crop record's last two values in that
order, as the reader takes them; the samples check now covers it.
This commit is contained in:
kiwi4boy committed 2026-11-19 23:53:57 -05:00
1 parent e5c911b900
commit 2958d98e8a
2 files changed
+8 -3

No files matched your search

+2 -2
View File
@@ -9,8 +9,8 @@
//! A picture on a page is a shape (3008, a rectangle drawn with its format as any shape is) holding
//! a 4014 container: 4015, the crop (left, top, right and bottom as i32s, in ten-thousandths of the
//! picture), and 4053 → 4036, the picture's slot number. The shape's box is the cropped picture's.
//! (On a notes page, 4014 → 4054 → 4032 names the slide its slide image shows instead.) Only the
//! left and top crops were seen set; the right and bottom are taken to follow in that order.
//! (On a notes page, 4014 → 4054 → 4032 names the slide its slide image shows instead.) Each of the
//! four crops was seen set: left and top in one file, right and bottom in another.
//!
//! The metafile is kept as it is, as `image/x-wmf` media, as the PowerPoint 97 path keeps the
//! metafiles of its blip store. Each slot is read once, the first time a shape names it, and all of
+6 -1
View File
@@ -1809,7 +1809,7 @@ fn check_sample(name: &str, p: &Presentation) {
// The automation reported 1295, 1367.5, 4610 × 720 twips.
assert_eq!(boxed(s), (64.75, 68.375, 230.5, 36.0));
}
"picture" | "jpeg" | "png" | "picwmf" | "piccrop" | "twopics" | "picshare" | "notes" | "notes2" => check_media_sample(name, p),
"picture" | "jpeg" | "png" | "picwmf" | "piccrop" | "piccrop2" | "twopics" | "picshare" | "notes" | "notes2" => check_media_sample(name, p),
_ => check_shape_sample(name, p),
}
}
@@ -1845,6 +1845,11 @@ fn check_media_sample(name: &str, p: &Presentation) {
let pics = pictures(0);
assert_eq!((pics.len(), pics[0].0, pics[0].2), (1, (90.0, 81.0, 54.0, 63.0), [0.25, 0.125, 0.0, 0.0]));
}
"piccrop2" => {
// CropRight 0.3 and CropBottom 0.05: the crop's last two values, in that order.
let pics = pictures(0);
assert_eq!((pics.len(), pics[0].0, pics[0].2), (1, (72.0, 72.0, 50.375, 68.375), [0.0, 0.0, 0.3, 0.05]));
}
"twopics" => {
let pics = pictures(0);
assert_eq!(pics.iter().map(|x| (x.0, x.3)).collect::<Vec<_>>(), [(inch, 128), ((216.0, 72.0, 144.0, 72.0), 220)]);