From 7d0db790032bddd29db1eaeb36c9c25929431748 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Fri, 27 Aug 2021 16:25:50 -0700 Subject: T.P.Image: svgToPng, change first parameter from WriterOptions to Int. The information we need is just a DPI, so why require more? --- src/Text/Pandoc/Image.hs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/Text') diff --git a/src/Text/Pandoc/Image.hs b/src/Text/Pandoc/Image.hs index e0c938938..ce3c0e41d 100644 --- a/src/Text/Pandoc/Image.hs +++ b/src/Text/Pandoc/Image.hs @@ -21,14 +21,14 @@ import qualified Control.Exception as E -- | Convert svg image to png. rsvg-convert -- is used and must be available on the path. -svgToPng :: WriterOptions +svgToPng :: Int -> L.ByteString -- ^ Input image as bytestring -> IO (Either Text L.ByteString) -svgToPng opts bs = do - let dpi = show $ writerDpi opts +svgToPng dpi bs = do + let dpi' = show dpi E.catch (do (exit, out) <- pipeProcess Nothing "rsvg-convert" - ["-f","png","-a","--dpi-x",dpi,"--dpi-y",dpi] + ["-f","png","-a","--dpi-x",dpi',"--dpi-y",dpi'] bs return $ if exit == ExitSuccess then Right out -- cgit v1.2.3