Only gc if thumbing.

This commit is contained in:
Jason A. Donenfeld 2011-05-06 02:49:26 -04:00
parent e11da0e963
commit 319ac51d60

View File

@ -128,11 +128,11 @@ class Photo(object):
pass pass
self._attributes[decoded] = value self._attributes[decoded] = value
def _thumbnail(self, image, thumb_path, size, square=False): def _thumbnail(self, image, thumb_path, size, square=False):
gc.collect()
thumb_path = os.path.join(thumb_path, image_cache(self._path, size, square)) thumb_path = os.path.join(thumb_path, image_cache(self._path, size, square))
print "Thumbing %s" % thumb_path print "Thumbing %s" % thumb_path
if os.path.exists(thumb_path) and file_mtime(thumb_path) >= self._attributes["DateTimeFile"]: if os.path.exists(thumb_path) and file_mtime(thumb_path) >= self._attributes["DateTimeFile"]:
return return
gc.collect()
image = image.copy() image = image.copy()
if square: if square:
if image.size[0] > image.size[1]: if image.size[0] > image.size[1]: