diff options
author | luxagraf@c63593aa-01b0-44d9-8516-4b9c7e931d7f <luxagraf@c63593aa-01b0-44d9-8516-4b9c7e931d7f> | 2010-03-13 19:34:03 +0000 |
---|---|---|
committer | luxagraf@c63593aa-01b0-44d9-8516-4b9c7e931d7f <luxagraf@c63593aa-01b0-44d9-8516-4b9c7e931d7f> | 2010-03-13 19:34:03 +0000 |
commit | 9aa6fa7cf6cb10103de9284e26db7e68b039a0b7 (patch) | |
tree | 6c89094d3ff8ed036d0e91173c2b23826b50e642 /apps/photos/utils.py | |
parent | 9dcc9b71adc118abb1f3191bd9753c9e97c839cb (diff) |
fixed photo importing tools
Diffstat (limited to 'apps/photos/utils.py')
-rw-r--r-- | apps/photos/utils.py | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/apps/photos/utils.py b/apps/photos/utils.py index 57a4cdb..9fe69ba 100644 --- a/apps/photos/utils.py +++ b/apps/photos/utils.py @@ -54,6 +54,8 @@ def sync_flickr_photos(*args, **kwargs): dupe = True print 'already have '+info['id']+' moving on' except ObjectDoesNotExist: + #for debugging: + print info['title'] taglist = [] location, region = get_geo(float(info['latitude']),float(info['longitude'])) details = client.flickr_photos_getInfo(user_id=settings.FLICKR_USER_ID, photo_id=force_unicode(info['id'])) @@ -86,7 +88,8 @@ def sync_flickr_photos(*args, **kwargs): ) #print info['title'], region, location photo.save() - #make_local_size(photo) + make_local_copies(photo) + slideshow_image(photo) def exif_handler(data): converted = {} @@ -137,7 +140,7 @@ def slideshow_image(photo): cur_width, cur_height = img.size #if image landscape if cur_width > cur_height: - new_width = 800 + new_width = 1000 #check to make sure we aren't upsizing if cur_width > new_width: ratio = float(new_width)/cur_width @@ -257,8 +260,10 @@ def sync_sets(*args, **kwargs): set_slug = slugify(force_unicode(post.findtext('title'))), primary = force_unicode(info['primary']), ) - get_photos_in_set(s) + #create the gallery thumbnail image: + photo = Photo.objects.get(flickr_id__exact=str(info['primary'])) + make_gallery_thumb(photo,s) def get_photos_in_set(set): BASE_PATH = 'http://flickr.com/services/rest/' |