Newer
Older
This function generates derivatives for image, audio, and video objects by generating from its original files low-resolution files and grouping them all into a folder structure.
# Installation
Functions can be found in the Configuration menu, in the Functions section.
![My Image](./images/create_function.png)
First thing to set in your function is the name, following the requirements for the name. Description is optional.
In the section below, place the code from the repo in the editor.
![My Image](./images/function_code.png)
# Configuration
Configuration section contains information about what to install for the function to work.
Copy command line and place in the Build commands box.
apt update && apt install -y ocrmypdf ffmpeg && pip install ocrmypdf && pip install pillow && pip install pydub && pip install opencv-python
```
![My Image](./images/function_config.png)
Triggers tell the function in what case it must be executed. For the derivatives function, it must be displayed only when folders
are selected.
![My Image](./images/function_trigger.png)
Regex must be the same as the image for directories only
Last thing to set is the parameters. This function needs three input parameters, the profile, the object class and the downscale value. The last one depends on the profile, depending on the chosen value, this field will be shown.
Profile is a value list parameter with options for all types of record. The values must be the next ones:
```ShellSession
Archives: MASTER + PDF + LOWRES derivatives
Image workflow with LOWRES [re-scaled] + PDF
Audio workflow with LOWRES_MP3 [MP3]
Video workflow with LOWRES_720p [MP4]
```
This field must be marqued as required.
Object class must be named as it is in the image: All selected
At last, the Conditional field must be created, this field depends on the Profile. This param is a value list with the scaling values for the images. Because this one is a conditional field, it must be shown when the user select a specific value. In this case, the value is a regex for the profile:
```ShellSession
Image workflow with LOWRES \[re-scaled\] \+ PDF
```
Parameter keys must be the same as the images to work.
When function is configured, save it and wait until the Status is set to ready
# Usage
It is available for any folder but it has to macth some requirements. Folder must not contain any subfolder as it will not be processed.
Depending on the selected profile, input files are different.
# Archives: MASTER + PDF + LOWRES derivatives
Needs tiff files as imput and this profile will generate 3 new folders in the object. Lowres with converted jpg images, Master with the original content and PDF with a one pdf file containing all tiff images.
# Image workflow with LOWRES [re-scaled] + PDF
This one works the same way as the previous, but also jpg files are allowed as imputs. With the donwscale value, imput files will be scaled using the selected percentage value. The process create Lowres, Master and PDF folders, like the other image profile.
# Audio workflow with LOWRES_MP3 [MP3]
For audio, the function will convert wav imput file to a mp3 and the structure will be Lowres with mp3 and master with the original content.
# Video workflow with LOWRES_720p [MP4]
This is the same as audio, but the imput is a mov video and the result is a mp4.