def unset_as_auto_crop(thumb):
    if not thumb.reference_thumb:
        return

    reference_thumb_box = thumb.reference_thumb.get_crop_box()
    crop = Crop(reference_thumb_box, DummyImage(thumb.image))
    best_fit = crop.best_fit(thumb.width, thumb.height)

    thumb.reference_thumb = None
    thumb.crop_w = best_fit.box.w
    thumb.crop_h = best_fit.box.h
    thumb.crop_x = best_fit.box.x1
    thumb.crop_y = best_fit.box.y1
    thumb.save()
Crop information is normalized on the parent Thumb row so auto-crops do not
dataset/ETHPy150Open theatlantic/django-cropduster/cropduster/utils/thumbs.py/unset_as_auto_crop