Allocate native PNG transparency and palette objects

This commit is contained in:
gloamxun committed 2026-11-27 21:30:31 +08:00
1 parent 51451813dc
commit 342bedf9b4
9 files changed
+215 -29

No files matched your search

+8
View File
@@ -460,6 +460,14 @@ fn png_project_edit_updates_only_the_page_using_the_image() {
));
assert_eq!(images[0].0.content, [0, 0, 255, 0, 255, 0]);
assert_eq!(images[0].1.content, [255, 128]);
let pages = document.get_pages();
let first_page = document.get_dictionary(pages[&1]).unwrap();
assert!(!first_page.has(b"Group"));
let image_page = document.get_dictionary(pages[&2]).unwrap();
let group = image_page.get(b"Group").unwrap().as_reference().unwrap();
let group = document.get_dictionary(group).unwrap();
assert_eq!(group.get(b"S").unwrap().as_name().unwrap(), b"Transparency");
assert_eq!(group.get(b"CS").unwrap().as_name().unwrap(), b"DeviceRGB");
fs::remove_dir_all(root).unwrap();
}