aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Writers
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2015-12-01 00:11:57 -0800
committerJohn MacFarlane <jgm@berkeley.edu>2015-12-01 00:23:03 -0800
commit622f09617e7ecac86024a0e63f4371112e315e2e (patch)
treef21edd2a011ee437f657fe30ac02c4544439e869 /src/Text/Pandoc/Writers
parent5c45a43399536e44d6a53db15e3344912412a32b (diff)
downloadpandoc-622f09617e7ecac86024a0e63f4371112e315e2e.tar.gz
Docx writer: better handling of PDF images.
Previously we tried to get the image size from the image even if an explicit size was specified. Since we still can't get image size for PDFs, this made it impossible to use PDF images in docx. Now we don't try to get the image size when a size is already explicitly specified.
Diffstat (limited to 'src/Text/Pandoc/Writers')
-rw-r--r--src/Text/Pandoc/Writers/Docx.hs10
1 files changed, 2 insertions, 8 deletions
diff --git a/src/Text/Pandoc/Writers/Docx.hs b/src/Text/Pandoc/Writers/Docx.hs
index dd4a4b258..c46a5efae 100644
--- a/src/Text/Pandoc/Writers/Docx.hs
+++ b/src/Text/Pandoc/Writers/Docx.hs
@@ -1117,14 +1117,8 @@ inlineToOpenXML opts (Image attr alt (src, tit)) = do
inlinesToOpenXML opts alt
Right (img, mt) -> do
ident <- ("rId"++) `fmap` getUniqueId
- (xpt,ypt) <- case imageSize img of
- Right size -> return $
- desiredSizeInPoints opts attr size
- Left msg -> do
- liftIO $ warn $
- "Could not determine image size in `" ++
- src ++ "': " ++ msg
- return (120,120)
+ let (xpt,ypt) = desiredSizeInPoints opts attr
+ (either (const def) id (imageSize img))
-- 12700 emu = 1 pt
let (xemu,yemu) = fitToPage (xpt * 12700, ypt * 12700) (pageWidth * 12700)
let cNvPicPr = mknode "pic:cNvPicPr" [] $