@@ -242,6 +242,7 @@ translate x y i = translateX x (translateY y i)
242242-- | Translates an image by padding or cropping its left side.
243243translateX :: Int -> Image -> Image
244244translateX x i
245+ | x < 0 && (abs x > imageWidth i) = emptyImage
245246 | x < 0 = let s = abs x in CropLeft i s (imageWidth i - s) (imageHeight i)
246247 | x == 0 = i
247248 | otherwise = let h = imageHeight i in HorizJoin (BGFill x h) i (imageWidth i + x) h
@@ -249,6 +250,7 @@ translateX x i
249250-- | Translates an image by padding or cropping its top.
250251translateY :: Int -> Image -> Image
251252translateY y i
253+ | y < 0 && (abs y > imageHeight i) = emptyImage
252254 | y < 0 = let s = abs y in CropTop i s (imageWidth i) (imageHeight i - s)
253255 | y == 0 = i
254256 | otherwise = let w = imageWidth i in VertJoin (BGFill w y) i w (imageHeight i + y)