refactor resize cell

Former-commit-id: 6e83b937ce
pull/1161/head
edgarriba 2015-12-01 16:23:32 +00:00
rodzic a259859ad9
commit 917d3f16fc
1 zmienionych plików z 45 dodań i 46 usunięć

Wyświetl plik

@ -25,8 +25,10 @@ class ODMResizeCell(ecto.Cell):
photos = self.inputs.photos
project_path = io.absolute_path_file(args['project_path'])
# loop over photos array
if photos:
if not photos:
log.ODM_ERROR('Not enough photos in photos to resize')
return ecto.QUIT
# create working directory
resizing_dir = io.join_paths(project_path, 'images_resize')
system.mkdir_p(resizing_dir)
@ -70,9 +72,6 @@ class ODMResizeCell(ecto.Cell):
(photo.filename, img_r.shape, args['resize_to']))
else:
log.ODM_WARNING('Already resized %s' % photo.filename)
else:
log.ODM_ERROR('Not enough photos in photos to resize')
return ecto.QUIT
log.ODM_INFO('Resized %s images' % len(photos))