Skip to content

Commit

Permalink
feat: image/imageutil: add ImageMetadata{}, NewImageMetadata()
Browse files Browse the repository at this point in the history
  • Loading branch information
grokify committed Jun 15, 2024
1 parent f6f592b commit 5146b61
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions image/imageutil/meta.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,3 +68,14 @@ func ImageColors(img image.Image) [][]color.Color {
}
return rows
}

type ImageMetadata struct {
Width uint
Height uint
}

func NewImageMetadata(img image.Image) ImageMetadata {
return ImageMetadata{
Width: uint(img.Bounds().Dx()),
Height: uint(img.Bounds().Dy())}
}

0 comments on commit 5146b61

Please sign in to comment.