T.P.PDF, convertImage: normalize paths.

This will avoid paths on Windows with mixed path separators,
which may cause problems with SVG conversion.

See #7431.
This commit is contained in:
John MacFarlane 2021-07-06 10:39:47 -07:00
parent f88ebf3ebf
commit e7f8cc5786

View file

@ -215,9 +215,9 @@ convertImage opts tmpdir fname = do
E.catch (Right pngOut <$ JP.savePngImage pngOut img) $
\(e :: E.SomeException) -> return (Left (tshow e))
where
pngOut = replaceDirectory (replaceExtension fname ".png") tmpdir
pdfOut = replaceDirectory (replaceExtension fname ".pdf") tmpdir
svgIn = tmpdir </> fname
pngOut = normalise $ replaceDirectory (replaceExtension fname ".png") tmpdir
pdfOut = normalise $ replaceDirectory (replaceExtension fname ".pdf") tmpdir
svgIn = normalise $ tmpdir </> fname
mime = getMimeType fname
doNothing = return (Right fname)