summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/ref/image.pngbin952767 -> 299090 bytes
-rw-r--r--tests/res/tiger-alpha.pngbin0 -> 122035 bytes
-rw-r--r--tests/typ/image.typ11
-rw-r--r--tests/typeset.rs2
4 files changed, 7 insertions, 6 deletions
diff --git a/tests/ref/image.png b/tests/ref/image.png
index 41fa6a9b..37349600 100644
--- a/tests/ref/image.png
+++ b/tests/ref/image.png
Binary files differ
diff --git a/tests/res/tiger-alpha.png b/tests/res/tiger-alpha.png
new file mode 100644
index 00000000..178b4b65
--- /dev/null
+++ b/tests/res/tiger-alpha.png
Binary files differ
diff --git a/tests/typ/image.typ b/tests/typ/image.typ
index ee82024f..0dd22950 100644
--- a/tests/typ/image.typ
+++ b/tests/typ/image.typ
@@ -1,14 +1,15 @@
-[page: width=10cm, height=10cm, margins=1cm]
+[page: width=5cm, height=5cm, margins=0.25cm]
[image: "res/tiger.jpg"]
[pagebreak]
# Tiger
-[image: "res/tiger.jpg", width=3cm]
-[image: "res/tiger.jpg", height=3cm]
+[image: "res/tiger.jpg", width=2cm]
+[image: "res/tiger-alpha.png", width=1cm]
+[image: "res/tiger-alpha.png", height=2cm]
[pagebreak]
-[align: center]
-[image: "res/tiger.jpg", width=6cm, height=6cm]
+[align: center, bottom]
+[image: "res/tiger.jpg", width=2cm, height=3.5cm]
diff --git a/tests/typeset.rs b/tests/typeset.rs
index 82d801a2..cc146fe4 100644
--- a/tests/typeset.rs
+++ b/tests/typeset.rs
@@ -248,7 +248,7 @@ fn draw_text(canvas: &mut Canvas, pos: Point, env: &Env, shaped: &Shaped) {
}
fn draw_image(canvas: &mut Canvas, pos: Point, env: &Env, image: &ImageElement) {
- let buf = env.resources.get_loaded::<DynamicImage>(image.resource);
+ let buf = env.resources.get_loaded::<DynamicImage>(image.res);
let mut pixmap = Pixmap::new(buf.width(), buf.height()).unwrap();
for ((_, _, src), dest) in buf.pixels().zip(pixmap.pixels_mut()) {