@@ -76,6 +76,9 @@ imageSize img = do
76 Eps -> epsSize img
76 Eps -> epsSize img
77 Pdf -> Nothing -- TODO
77 Pdf -> Nothing -- TODO
79+defaultSize :: (Integer, Integer)
80+defaultSize = (72, 72)
79sizeInPixels :: ImageSize -> (Integer, Integer)
82sizeInPixels :: ImageSize -> (Integer, Integer)
80sizeInPixels s = (pxX s, pxY s)
83sizeInPixels s = (pxX s, pxY s)
@@ -260,7 +263,9 @@ exifHeader hdr = do
260 lookup ExifImageHeight allentries) of
263 lookup ExifImageHeight allentries) of
261 (Just (UnsignedLong w), Just (UnsignedLong h)) ->
264 (Just (UnsignedLong w), Just (UnsignedLong h)) ->
262 return (fromIntegral w, fromIntegral h)
265 return (fromIntegral w, fromIntegral h)
263− _ -> fail "Could not determine image width, height"
266+ _ -> return defaultSize
267+ -- we return a default width and height when
268+ -- the exif header doesn't contain these
264 let resfactor = case lookup ResolutionUnit allentries of
269 let resfactor = case lookup ResolutionUnit allentries of
265 Just (UnsignedShort 1) -> (100 / 254)
270 Just (UnsignedShort 1) -> (100 / 254)