Fix crash caused by referencing an unbound local variable. (#128)

Co-authored-by: Eric Patey <>
This commit is contained in:
Eric Patey
2025-02-07 10:31:53 -05:00
committed by GitHub
parent 3ee6c34a36
commit bf3f054564

View File

@@ -49,11 +49,16 @@ def check_image_stretch_and_center(modified_ppt, original_ppt):
the_image = original_slide_images[0]
the_modified_image = None
# Get the images that modified in width and height
for modified_image in modified_slide_images:
if the_image.image.blob == modified_image.image.blob:
the_modified_image = modified_image
if the_modified_image is None:
return 0.
if (abs(the_modified_image.width - original_pres.slide_width) > Inches(0.5) or
abs(the_modified_image.height - original_pres.slide_height) > Inches(0.5) or
abs(the_modified_image.left - (original_pres.slide_width - the_modified_image.width) / 2) > Inches(0.5) or