Fix minimum crop origin and update `detect-crop.sh` to 3.1.