Hash tag back. Garbage collection.

This commit is contained in:
Jason A. Donenfeld 2011-05-06 02:43:54 -04:00
parent 0c7d542b46
commit e11da0e963
2 changed files with 3 additions and 1 deletions

View File

@ -4,6 +4,7 @@ import json
import os.path import os.path
from PIL import Image from PIL import Image
from PIL.ExifTags import TAGS from PIL.ExifTags import TAGS
import gc
class Album(object): class Album(object):
def __init__(self, path): def __init__(self, path):
@ -127,6 +128,7 @@ 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"]:

View File

@ -66,7 +66,7 @@ $(document).ready(function() {
$(document.body).html("Wrong picture."); $(document.body).html("Wrong picture.");
return; return;
} }
$("#photo").html("<a href=\"javascript:history.back(-1)\"><img src=\"" + imagePath(current_album.photos[index].name, current_album.path, 640, false) + "\"></a>"); $("#photo").html("<a href=\"#" + current_album_cache + "\"><img src=\"" + imagePath(current_album.photos[index].name, current_album.path, 640, false) + "\"></a>");
$("#album").fadeOut(); $("#album").fadeOut();
$("#photo").fadeIn(); $("#photo").fadeIn();
} }