@@ -115,13 +115,13 @@ imageType img = case B.take 4 img of
115115 -- B.groupBy openingTag matches first "<svg" or "<html" but not "<!--"
116116 openingTag x y = x == '<' && y /= '!'
117117
118−imageSize :: ByteString -> Either String ImageSize
119−imageSize img =
118+imageSize :: WriterOptions -> ByteString -> Either String ImageSize
119+imageSize opts img =
120120 case imageType img of
121121 Just Png -> mbToEither "could not determine PNG size" $ pngSize img
122122 Just Gif -> mbToEither "could not determine GIF size" $ gifSize img
123123 Just Jpeg -> jpegSize img
124− Just Svg -> mbToEither "could not determine SVG size" $ svgSize img
124+ Just Svg -> mbToEither "could not determine SVG size" $ svgSize opts img
125125 Just Eps -> mbToEither "could not determine EPS size" $ epsSize img
126126 Just Pdf -> Left "could not determine PDF size" -- TODO
127127 Nothing -> Left "could not determine image type"
@@ -286,10 +286,9 @@ gifSize img = do
286286 }
287287 _ -> Nothing -- "GIF parse error"
288288
289−svgSize :: ByteString -> Maybe ImageSize
290−svgSize img = do
289+svgSize :: WriterOptions -> ByteString -> Maybe ImageSize
290+svgSize opts img = do
291291 doc <- Xml.parseXMLDoc $ UTF8.toString img
292− let opts = def --TODO: use proper opts instead of def, which simply contains dpi=72
293292 let dpi = fromIntegral $ writerDpi opts
294293 let dirToInt dir = do
295294 dim <- Xml.findAttrBy (== Xml.QName dir Nothing Nothing) doc >>= lengthToDim