Skip to content

Commit c3710cd

Browse files
committed
test(docx): add PNG fallback generation test for SVG
Just look at --trace output. Can't use a golden test because the actual .png will be different depending on rsvg-convert version. Signed-off-by: Edwin Török <[email protected]>
1 parent d8d0c19 commit c3710cd

File tree

1 file changed

+52
-0
lines changed

1 file changed

+52
-0
lines changed

test/command/9288.md

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
```
2+
% pandoc -f native -t docx -o 9288.docx --trace
3+
[ Figure
4+
( "" , [] , [] )
5+
(Caption Nothing [ Plain [ Str "5in" ] ])
6+
[ Plain
7+
[ Image
8+
( "" , [] , [ ( "width" , "5in" ) ] )
9+
[ Str "5in" ]
10+
( "command/SVG_logo.svg" , "" )
11+
]
12+
]
13+
, Figure
14+
( "" , [] , [] )
15+
(Caption Nothing [ Plain [ Str "5in" ] ])
16+
[ Plain
17+
[ Image
18+
( "" , [] , [ ( "width" , "5in" ) ] )
19+
[ Str "5in" ]
20+
( "command/SVG_logo.svg" , "" )
21+
]
22+
]
23+
, Figure
24+
( "" , [] , [] )
25+
(Caption Nothing [ Plain [ Str "80%" ] ])
26+
[ Plain
27+
[ Image
28+
( "" , [] , [ ( "width" , "80%" ) ] )
29+
[ Str "5in" ]
30+
( "command/SVG_logo.svg" , "" )
31+
]
32+
]
33+
, Figure
34+
( "" , [] , [] )
35+
(Caption Nothing [ Plain [ Str "default" ] ])
36+
[ Plain
37+
[ Image
38+
( "" , [] , [] )
39+
[ Str "5in" ]
40+
( "command/SVG_logo.svg" , "" )
41+
]
42+
]
43+
]
44+
^D
45+
2> [trace] rsvg-convert -f png -a --dpi-x 96 --dpi-y 96 --width 360.000000pt --height 360.000000pt
46+
2> [trace] Found fallback "media/rId20.svg_4572000_4572000.png"
47+
2> [trace] Found fallback "media/rId20.svg_4572000_4572000.png"
48+
2> [trace] rsvg-convert -f png -a --dpi-x 96 --dpi-y 96 --width 75.000000pt --height 75.000000pt
49+
2> [trace] Found fallback "media/rId20.svg_952500_952500.png"
50+
2> [trace] Found fallback "media/rId20.svg_952500_952500.png"
51+
52+
```

0 commit comments

Comments
 (0)