extensions

This commit is contained in:
Ryan Oldenburg 2020-11-21 20:02:57 -06:00
parent df0756941c
commit 137a832c3a

View file

@ -54,9 +54,9 @@ proc writeFile*(image: Image, filePath: string, fileFormat: FileFormat) =
proc writeFile*(image: Image, filePath: string) = proc writeFile*(image: Image, filePath: string) =
## Writes an image to a file. ## Writes an image to a file.
let fileFormat = case splitFile(filePath).ext: let fileFormat = case splitFile(filePath).ext:
of "png": ffPng of ".png": ffPng
of "bmp": ffBmp of ".bmp": ffBmp
of "jpg": ffJpg of ".jpg": ffJpg
else: else:
raise newException(PixieError, "Unrecognized file extension") raise newException(PixieError, "Unrecognized file extension")
image.writeFile(filePath, fileformat) image.writeFile(filePath, fileformat)