Port thumbnail generation task
Refs https://redmine.teklia.com/issues/6067
Easier after workers/base-worker#290 (closed)
We need to convert the code for thumbnails generation from arkindex tasks as a standalone worker.
It will use base-worker, and be implemented as an ElementsWorker.
There will be no handling of local JSON files anymore, instead relying on process_element
to build a thumbnail for folders with 1 or more children images.
You can probably use generic methods from base worker for some API calls instead of using directly the arkindex API client.
Workflow:
- Process folders (skip element with a message,
if element.folder is False
) - Retrieve first elements (port
_list_folder_elements
) - Retrieve their images (port
get_first_images
) - Build the thumbnail (port
generate_thumbnail
) - Upload it (use the helper from base-worker)
Configuration parameters:
-
width: 900
, used as parameter inget_first_images
User configuration parameters:
-
first_n
: number of images to use to build the thumbnails, int, defaults to 3.
Use arkindex_worker.image.open_image
instead of porting the method.
Edited by Yoann Schneider