Add some options

This commit is contained in:
Milan Nikolic
2025-06-14 01:45:32 +02:00
parent fd5cb861cd
commit 7e4e58029a
15 changed files with 128 additions and 96 deletions

View File

@@ -24,11 +24,18 @@ func Rotate(img image.Image, angle int) image.Image {
return img
}
func Timestamp(img image.Image, format string) (image.Image, error) {
if format == "" {
format = "2006-01-02 15:04:05"
func Flip(img image.Image, dir string) image.Image {
switch dir {
case "horizontal":
img = transform.FlipH(img)
case "vertical":
img = transform.FlipV(img)
}
return img
}
func Timestamp(img image.Image, format string) (image.Image, error) {
dimg, ok := img.(draw.Image)
if !ok {
return img, fmt.Errorf("camera: %T is not a drawable image type", img)