git.iko.soy/typeable/pandoc
on master help sign in
ICML writer: fix image bounding box for custom widths/heights
208cb96mb21
src/Text/Pandoc/Writers/ICML.hs+6−1
@@ -621,7 +621,12 @@ imageICML opts style attr (src, _) = do
621 image = inTags True "Image"
621 image = inTags True "Image"
622 [("Self","ue6"), ("ItemTransform", scale<>" -"<>hw<>" -"<>hh)]
622 [("Self","ue6"), ("ItemTransform", scale<>" -"<>hw<>" -"<>hh)]
623 $ vcat [
623 $ vcat [
624+ inTags True "Properties" [] $ vcat [
624− inTags True "Properties" [] $ inTags True "Profile" [("type","string")] $ text "$ID/Embedded"
625+ inTags True "Profile" [("type","string")] $ text "$ID/Embedded"
626+ , selfClosingTag "GraphicBounds" [("Left","0"), ("Top","0")
627+ , ("Right", showFl $ ow*ow / imgWidth)
628+ , ("Bottom", showFl $ oh*oh / imgHeight)]
629+ ]
625 , selfClosingTag "Link" [("Self", "ueb"), ("LinkResourceURI", src')]
630 , selfClosingTag "Link" [("Self", "ueb"), ("LinkResourceURI", src')]
626 ]
631 ]
627 doc = inTags True "CharacterStyleRange" attrs
632 doc = inTags True "CharacterStyleRange" attrs
test/command/5541-nesting.md+1
@@ -80,6 +80,7 @@
80 <Profile type="string">
80 <Profile type="string">
81 $ID/Embedded
81 $ID/Embedded
82 </Profile>
82 </Profile>
83+ <GraphicBounds Left="0" Top="0" Right="150" Bottom="150" />
83 </Properties>
84 </Properties>
84 <Link Self="ueb" LinkResourceURI="file:lalune.jpg" />
85 <Link Self="ueb" LinkResourceURI="file:lalune.jpg" />
85 </Image>
86 </Image>
test/command/svg.md+4
@@ -23,6 +23,7 @@
23 <Profile type="string">
23 <Profile type="string">
24 $ID/Embedded
24 $ID/Embedded
25 </Profile>
25 </Profile>
26+ <GraphicBounds Left="0" Top="0" Right="300" Bottom="200" />
26 </Properties>
27 </Properties>
27 <Link Self="ueb" LinkResourceURI="file:command/corrupt.svg" />
28 <Link Self="ueb" LinkResourceURI="file:command/corrupt.svg" />
28 </Image>
29 </Image>
@@ -56,6 +57,7 @@
56 <Profile type="string">
57 <Profile type="string">
57 $ID/Embedded
58 $ID/Embedded
58 </Profile>
59 </Profile>
60+ <GraphicBounds Left="0" Top="0" Right="300" Bottom="200" />
59 </Properties>
61 </Properties>
60 <Link Self="ueb" LinkResourceURI="file:command/SVG_logo.svg" />
62 <Link Self="ueb" LinkResourceURI="file:command/SVG_logo.svg" />
61 </Image>
63 </Image>
@@ -89,6 +91,7 @@
89 <Profile type="string">
91 <Profile type="string">
90 $ID/Embedded
92 $ID/Embedded
91 </Profile>
93 </Profile>
94+ <GraphicBounds Left="0" Top="0" Right="300" Bottom="200" />
92 </Properties>
95 </Properties>
93 <Link Self="ueb" LinkResourceURI="file:command/SVG_logo-without-xml-declaration.svg" />
96 <Link Self="ueb" LinkResourceURI="file:command/SVG_logo-without-xml-declaration.svg" />
94 </Image>
97 </Image>
@@ -122,6 +125,7 @@
122 <Profile type="string">
125 <Profile type="string">
123 $ID/Embedded
126 $ID/Embedded
124 </Profile>
127 </Profile>
128+ <GraphicBounds Left="0" Top="0" Right="109.5" Bottom="130.5" />
125 </Properties>
129 </Properties>
126 <Link Self="ueb" LinkResourceURI="file:command/inkscape-cube.svg" />
130 <Link Self="ueb" LinkResourceURI="file:command/inkscape-cube.svg" />
127 </Image>
131 </Image>
test/writer.icml+2
@@ -2800,6 +2800,7 @@ These should not be escaped: \$ \\ \&gt; \[ \{</Content>
2800 <Profile type="string">
2800 <Profile type="string">
2801 $ID/Embedded
2801 $ID/Embedded
2802 </Profile>
2802 </Profile>
2803+ <GraphicBounds Left="0" Top="0" Right="150" Bottom="150" />
2803 </Properties>
2804 </Properties>
2804 <Link Self="ueb" LinkResourceURI="file:lalune.jpg" />
2805 <Link Self="ueb" LinkResourceURI="file:lalune.jpg" />
2805 </Image>
2806 </Image>
@@ -2836,6 +2837,7 @@ These should not be escaped: \$ \\ \&gt; \[ \{</Content>
2836 <Profile type="string">
2837 <Profile type="string">
2837 $ID/Embedded
2838 $ID/Embedded
2838 </Profile>
2839 </Profile>
2840+ <GraphicBounds Left="0" Top="0" Right="20" Bottom="22" />
2839 </Properties>
2841 </Properties>
2840 <Link Self="ueb" LinkResourceURI="file:movie.jpg" />
2842 <Link Self="ueb" LinkResourceURI="file:movie.jpg" />
2841 </Image>
2843 </Image>