def set_image_dpi_ppi(file_path):
    im = Image.open(file_path)
    (length_x, width_y) = im.size
    factor = float((length_x / width_y))
    size = (int(600), int((600 / factor)))
    im_resized = im.resize(size, Image.ANTIALIAS)
    temp_file = tempfile.NamedTemporaryFile(delete=False, suffix='.png')
    temp_filename = temp_file.name
    im_resized.save(temp_filename, dpi=(800, 800))
    return temp_filename
def set_image_dpi_ppi(file_path):
    im = Image.open(file_path)
    (length_x, width_y) = im.size
    factor = float((length_x / width_y))
    size = (int(600), int((600 / factor)))
    im_resized = im.resize(size, Image.ANTIALIAS)
    temp_file = tempfile.NamedTemporaryFile(delete=False, suffix='.png')
    temp_filename = temp_file.name
    im_resized.save(temp_filename, dpi=(800, 800))
    return temp_filename