mirror of
https://github.com/jgm/pandoc.git
synced 2026-09-24 16:35:42 +00:00
T.P.Image: svgToPng, change first parameter from WriterOptions to Int.
The information we need is just a DPI, so why require more?
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user