feat(#15): add benchmark tests

This commit is contained in:
Tomas Aparicio 2015-04-07 23:23:42 +02:00
parent 16576f49c9
commit bfe0e700ce
5 changed files with 77 additions and 36 deletions

View file

@ -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()