The purpose of this repository is to provide a way for people to create placeholder images quickly.
https://www.craigoates.net/Software/project/11
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
728 B
23 lines
728 B
6 years ago
|
namespace SmoulderingBeachBall
|
||
|
|
||
6 years ago
|
module Services =
|
||
6 years ago
|
|
||
|
open System
|
||
6 years ago
|
open SmoulderingBeachBall.Domain.DomainTypes
|
||
6 years ago
|
open InternalServices.Validation
|
||
|
open InternalServices.Drawing
|
||
|
|
||
|
let makeImage (spec: ImageSpec) =
|
||
|
async {
|
||
|
try
|
||
|
printfn "[INFO.] Attempting to make image..."
|
||
|
validateDimension spec.width
|
||
|
validateDimension spec.height
|
||
|
validateDirectory spec.filePath
|
||
|
drawImage spec
|
||
|
printfn "[SUCCESS] Image creation attempt complete."
|
||
|
return ()
|
||
|
with
|
||
|
| :? ArgumentException as ex -> printfn "%s" ex.Message
|
||
|
| _ as ex -> printfn "%s" ex.Message
|
||
|
}
|