Skip to content

Commit

Permalink
Correct bug in image thumbnailing routine #318
Browse files Browse the repository at this point in the history
When a thumbnail is orphaned and needed to be removed, we accidentally
were running an image check on it and dying with an error.  Now, we do
image checks first, *then* add and delete thumbnails for the current
family as appropriate.
  • Loading branch information
brandon-rhodes committed Dec 12, 2012
1 parent b528b66 commit b8da630
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions bin/s3imagecheck.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,14 @@ def check_family(operator, family_name):
thumbdir = operator.make_thumbdir(thumbsize, family_name)
thumbs = operator.list_thumbnails(thumbdir)

check_images(operator, thumbs)

for thumb in thumbs:
thumb_name = name_of(thumb)
if thumb_name not in image_names:
operator.error(thumb, 'Thumbnail is an orphan; deleting')
thumb.delete()

check_images(operator, thumbs)

thumb_names = names_of(thumbs)
for image in images:
if name_of(image) not in thumb_names:
Expand Down

0 comments on commit b8da630

Please sign in to comment.