Autocrop functionality (not tested)