aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc
diff options
context:
space:
mode:
Diffstat (limited to 'src/Text/Pandoc')
-rw-r--r--src/Text/Pandoc/Writers/Docx.hs7
-rw-r--r--src/Text/Pandoc/Writers/ODT.hs6
-rw-r--r--src/Text/Pandoc/Writers/RTF.hs5
3 files changed, 13 insertions, 5 deletions
diff --git a/src/Text/Pandoc/Writers/Docx.hs b/src/Text/Pandoc/Writers/Docx.hs
index cacf5102f..475f4e2ac 100644
--- a/src/Text/Pandoc/Writers/Docx.hs
+++ b/src/Text/Pandoc/Writers/Docx.hs
@@ -1122,8 +1122,11 @@ inlineToOpenXML opts (Image alt (src, tit)) = do
ident <- ("rId"++) `fmap` getUniqueId
(xpt,ypt) <- case imageSize img of
Right size -> return $ sizeInPoints size
- Left msg -> do liftIO (warn msg)
- return (120,120)
+ Left msg -> do
+ liftIO $ warn $
+ "Could not determine image size in `" ++
+ src ++ "': " ++ msg
+ return (120,120)
-- 12700 emu = 1 pt
let (xemu,yemu) = fitToPage (xpt * 12700, ypt * 12700) (pageWidth * 12700)
let cNvPicPr = mknode "pic:cNvPicPr" [] $
diff --git a/src/Text/Pandoc/Writers/ODT.hs b/src/Text/Pandoc/Writers/ODT.hs
index 33d9ec9d2..e7c1cf32e 100644
--- a/src/Text/Pandoc/Writers/ODT.hs
+++ b/src/Text/Pandoc/Writers/ODT.hs
@@ -136,8 +136,10 @@ transformPicMath opts entriesRef (Image lab (src,t)) = do
Right (img, mbMimeType) -> do
(w,h) <- case imageSize img of
Right size -> return $ sizeInPoints size
- Left msg -> do warn msg
- return (0,0)
+ Left msg -> do
+ warn $ "Could not determine image size in `" ++
+ src ++ "': " ++ msg
+ return (0,0)
let tit' = show w ++ "x" ++ show h
entries <- readIORef entriesRef
let extension = fromMaybe (takeExtension $ takeWhile (/='?') src)
diff --git a/src/Text/Pandoc/Writers/RTF.hs b/src/Text/Pandoc/Writers/RTF.hs
index 588506f34..9eb02ad02 100644
--- a/src/Text/Pandoc/Writers/RTF.hs
+++ b/src/Text/Pandoc/Writers/RTF.hs
@@ -57,7 +57,10 @@ rtfEmbedImage opts x@(Image _ (src,_)) = do
"image/png" -> "\\pngblip"
_ -> error "Unknown file type"
sizeSpec <- case imageSize imgdata of
- Left msg -> warn msg >> return ""
+ Left msg -> do
+ warn $ "Could not determine image size in `" ++
+ src ++ "': " ++ msg
+ return ""
Right sz -> return $ "\\picw" ++ show xpx ++
"\\pich" ++ show ypx ++
"\\picwgoal" ++ show (xpt * 20)