From a7192297dfc31d02bddd680881f7bc6d50b38791 Mon Sep 17 00:00:00 2001 From: Joachim Tingvold Date: Sun, 16 Mar 2014 15:19:52 +0100 Subject: [PATCH] Indents (-: --- scanner/PhotoAlbum.py | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/scanner/PhotoAlbum.py b/scanner/PhotoAlbum.py index 760bfa2..8ad5f89 100644 --- a/scanner/PhotoAlbum.py +++ b/scanner/PhotoAlbum.py @@ -232,9 +232,8 @@ class Photo(object): _metadata.scene_capture_type_list = ["Standard", "Landscape", "Portrait", "Night scene"] _metadata.subject_distance_range_list = ["Unknown", "Macro", "Close view", "Distant view"] - def _thumbnail(self, image, thumb_path, original_path, size, square=False): - def _thumbnail(self, original_path, thumb_path, size, square=False): - try: + def _thumbnail(self, original_path, thumb_path, size, square=False): + try: image = Image.open(original_path) except KeyboardInterrupt: raise @@ -264,7 +263,7 @@ class Photo(object): elif self._orientation == 8: # Rotation 90 mirror = image.transpose(Image.ROTATE_90) - image = mirror + image = mirror thumb_path = os.path.join(thumb_path, image_cache(self._path, size, square)) info_string = "%s -> %spx" % (os.path.basename(original_path), str(size)) @@ -309,14 +308,14 @@ class Photo(object): message("save failure", os.path.basename(thumb_path)) os.unlink(thumb_path) - def _thumbnails(self, original_path, thumb_path): - # get number of cores on the system, and use all minus one - num_of_cores = os.sysconf('SC_NPROCESSORS_ONLN') - 1 - pool = Pool(processes=num_of_cores) - for size in Photo.thumb_sizes: - pool.apply_async(make_thumbs, args = (self, original_path, thumb_path, size)) - pool.close() - pool.join() + def _thumbnails(self, original_path, thumb_path): + # get number of cores on the system, and use all minus one + num_of_cores = os.sysconf('SC_NPROCESSORS_ONLN') - 1 + pool = Pool(processes=num_of_cores) + for size in Photo.thumb_sizes: + pool.apply_async(make_thumbs, args = (self, original_path, thumb_path, size)) + pool.close() + pool.join() @property def name(self):