smartcrop implementation in Go