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
namespace SmoulderingBeachBall |
|
|
|
module Services = |
|
|
|
open System |
|
open SmoulderingBeachBall.Domain.DomainTypes |
|
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 |
|
} |