# HG changeset patch # User Tero Marttila # Date 1245014983 -10800 # Node ID 31c4a328ef96f6399565c62fb81633a8baf2839c # Parent 292aaba6d6ec45e5f07160ae2e9bd8afb33dbc60 move the uncache-del's from commands.main to Image.cleanup, and call it after rendering each image's thumbs diff -r 292aaba6d6ec -r 31c4a328ef96 degal/commands/main.py --- a/degal/commands/main.py Mon Jun 15 00:23:55 2009 +0300 +++ b/degal/commands/main.py Mon Jun 15 00:29:43 2009 +0300 @@ -35,6 +35,11 @@ """ # XXX: handle this thumb-update/html-update stuff better + + # render all HTML + for image in images : + render_image_html(ctx, image) + # render the thumbnails concurrently for image in ctx.concurrent.execute( @@ -48,14 +53,9 @@ ) : # log image path ctx.log_info("%s", image) - - # then render all HTML - for image in images : - render_image_html(ctx, image) # release large objects that are not needed anymore - # XXX: verify that this works - del image.img + image.cleanup() def render_folder_html (ctx, folder) : """ diff -r 292aaba6d6ec -r 31c4a328ef96 degal/image.py --- a/degal/image.py Mon Jun 15 00:23:55 2009 +0300 +++ b/degal/image.py Mon Jun 15 00:29:43 2009 +0300 @@ -122,4 +122,13 @@ self.preview.update() self.thumb.update() + + def cleanup (self) : + """ + Drop some cached heavy values + """ + del self.img + del self.exif + del self.metadata + diff -r 292aaba6d6ec -r 31c4a328ef96 degal/thumbnail.py --- a/degal/thumbnail.py Mon Jun 15 00:23:55 2009 +0300 +++ b/degal/thumbnail.py Mon Jun 15 00:29:43 2009 +0300 @@ -63,7 +63,8 @@ height = thumb_height return width, height - + + ## operations def resize (self, img) : """ Resize the give image as needed. @@ -80,7 +81,7 @@ mirroring, rotation = orient_info if mirroring : - # XXX + # XXX: does anyone actually use this? pass if rotation :