From e3115336bfe26cfddcce41dc9177f3bbe6d7d88e Mon Sep 17 00:00:00 2001 From: Beiri22 Date: Sat, 5 Aug 2023 13:58:28 +0200 Subject: Decode image (#1810) --- tests/typ/visualize/image.typ | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'tests/typ/visualize') diff --git a/tests/typ/visualize/image.typ b/tests/typ/visualize/image.typ index e3bcc64f..60ce4f68 100644 --- a/tests/typ/visualize/image.typ +++ b/tests/typ/visualize/image.typ @@ -60,3 +60,23 @@ A #box(image("/files/tiger.jpg", height: 1cm, width: 80%)) B --- // Error: 2-25 failed to parse svg: found closing tag 'g' instead of 'style' in line 4 #image("/files/bad.svg") + +--- +// Test parsing from svg data +#image.decode(``.text, format: "svg") + +--- +// Error: 2-168 failed to parse svg: missing root node +#image.decode(``.text, format: "svg") + +--- +// Test format auto detect +#image.decode(read("/files/tiger.jpg", encoding: none), width: 80%) + +--- +// Test format manual +#image.decode(read("/files/tiger.jpg", encoding: none), format: "jpg", width: 80%) + +--- +// Error: 2-83 failed to decode image +#image.decode(read("/files/tiger.jpg", encoding: none), format: "png", width: 80%) -- cgit v1.2.3