def METHOD_NAME(fpath_in, fpath_out, page_number=0, crop=None):
    """
    Create an image from the pdf at fpath_in and write result to fpath_out.
    """
    try:
        assert fpath_in.endswith("pdf"), "File must be in pdf format"
        pages = convert_from_path(
            fpath_in, 500, first_page=page_number, last_page=page_number + 1
        )
        page = pages[0]
        # resize
        page = scale_and_crop_thumbnail(page, zoom=10, crop=crop)
        page.save(fpath_out, "PNG")
    except Exception as e:
        raise ThumbnailGenerationError("Fail on PDF {} {}".format(fpath_in, e))