diff options
Diffstat (limited to 'apps/photos')
-rw-r--r-- | apps/photos/models.py | 6 | ||||
-rw-r--r-- | apps/photos/retriever.py | 5 |
2 files changed, 6 insertions, 5 deletions
diff --git a/apps/photos/models.py b/apps/photos/models.py index 074016a..5766e19 100644 --- a/apps/photos/models.py +++ b/apps/photos/models.py @@ -156,11 +156,7 @@ class Photo(models.Model): def comment_period_open(self): return self.enable_comments and datetime.datetime.today() - datetime.timedelta(30) <= self.pub_date - def save(self): - self.slideshowimage_width = self.get_width - self.slideshowimage_height = self.get_height - self.slideshowimage_margintop = self.get_margin_top - self.slideshowimage_marginleft = self.get_margin_left + def save(self, *args, **kwargs): super(Photo, self).save() class PhotoGallery(models.Model): diff --git a/apps/photos/retriever.py b/apps/photos/retriever.py index 137fe9f..f7114fd 100644 --- a/apps/photos/retriever.py +++ b/apps/photos/retriever.py @@ -173,6 +173,10 @@ def slideshow_image(photo): else: filename = '%s/%s.jpg' %(slide_dir, photo.flickr_id) img.save(filename) + photo.slideshowimage_width = photo.get_width + photo.slideshowimage_height = photo.get_height + photo.slideshowimage_margintop = photo.get_margin_top + photo.slideshowimage_marginleft = photo.get_margin_left def make_local_copies(photo): orig_dir = settings.IMAGES_ROOT + '/flickr/full/'+ photo.pub_date.strftime("%Y") @@ -206,6 +210,7 @@ def make_local_copies(photo): local_med = '%s/%s.jpg' %(med_dir, photo.flickr_id) img.save(local_med) + def make_gallery_thumb(photo,set): crop_dir = settings.IMAGES_ROOT + '/gallery_thumbs/' |