summaryrefslogtreecommitdiff
path: root/tests/suite
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2025-07-09 15:48:43 +0200
committerGitHub <noreply@github.com>2025-07-09 13:48:43 +0000
commit3aa7e861e7ffe03193d94c2cfd249739ef746f09 (patch)
tree063945efc6eca31a1f2703fc3127e8723e2eab2d /tests/suite
parenta45c3388a642d6d7321b5c5b684d3582e91cff41 (diff)
Support images in HTML export (#6578)
Diffstat (limited to 'tests/suite')
-rw-r--r--tests/suite/visualize/image.typ23
1 files changed, 19 insertions, 4 deletions
diff --git a/tests/suite/visualize/image.typ b/tests/suite/visualize/image.typ
index 45c70c4b..36ec06cb 100644
--- a/tests/suite/visualize/image.typ
+++ b/tests/suite/visualize/image.typ
@@ -9,6 +9,9 @@
#set page(height: 60pt)
#image("/assets/images/tiger.jpg")
+--- image-jpg-html-base64 html ---
+#image("/assets/images/f2t.jpg", alt: "The letter F")
+
--- image-sizing ---
// Test configuring the size and fitting behaviour of images.
@@ -128,7 +131,7 @@ A #box(image("/assets/images/tiger.jpg", height: 1cm, width: 80%)) B
width: 1cm,
)
---- image-scaling-methods ---
+--- image-scaling-methods render html ---
#let img(scaling) = image(
bytes((
0xFF, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, 0xFF,
@@ -144,14 +147,26 @@ A #box(image("/assets/images/tiger.jpg", height: 1cm, width: 80%)) B
scaling: scaling,
)
-#stack(
- dir: ltr,
- spacing: 4pt,
+#let images = (
img(auto),
img("smooth"),
img("pixelated"),
)
+#context if target() == "html" {
+ // TODO: Remove this once `stack` is supported in HTML export.
+ html.div(
+ style: "display: flex; flex-direction: row; gap: 4pt",
+ images.join(),
+ )
+} else {
+ stack(
+ dir: ltr,
+ spacing: 4pt,
+ ..images,
+ )
+}
+
--- image-natural-dpi-sizing ---
// Test that images aren't upscaled.
// Image is just 48x80 at 220dpi. It should not be scaled to fit the page