Package calipers measures the dimensions of image files quickly by not loading the entire image into memory.
package main
import (
"github.com/mgartner/calipers-go"
)
func main() {
result, err := calipers.Measure("path/to/file.png")
fmt.Printf("%#v\n", result)
// calipers.Measurement{Type:"png", Width: 100, Height:60}
}
- GIF
- PNG
JPEG(coming soon)
Feel free to submit a PR!