mirror of
https://github.com/talgo-cloud/bimg.git
synced 2026-03-13 09:20:29 -07:00
feat(#15): add benchmark tests
This commit is contained in:
parent
16576f49c9
commit
bfe0e700ce
5 changed files with 77 additions and 36 deletions
|
|
@ -21,6 +21,7 @@ type ImageMetadata struct {
|
|||
Size ImageSize
|
||||
}
|
||||
|
||||
// Get the image size by width and height pixels
|
||||
func Size(buf []byte) (ImageSize, error) {
|
||||
metadata, err := Metadata(buf)
|
||||
if err != nil {
|
||||
|
|
@ -33,6 +34,7 @@ func Size(buf []byte) (ImageSize, error) {
|
|||
}, nil
|
||||
}
|
||||
|
||||
// Extract the image metadata (size, type, alpha channel, profile, EXIF orientation...)
|
||||
func Metadata(buf []byte) (ImageMetadata, error) {
|
||||
defer C.vips_thread_shutdown()
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue