occtoo media to upload files into a media source, give them properties from a spreadsheet, look at and delete assets, and convert images.
Upload files
--tonames a media source, optionally followed by a folder:<SOURCE>/<FOLDER>. Leave it out in a terminal to pick the source and folder from a list.- A folder is uploaded with everything in it.
photos/shoes/front.jpggoes into the folderphotos/shoesbelow the destination. Folders the source doesn’t have are created. Hidden files are left out. - The entry key of a file is its name without the extension, so
sku-123.jpgbecomes the entrysku-123. Characters other than letters, digits,_and-become-.
Give files properties
Files get their properties from a metadata file: CSV or Excel, with one row per file.occtoo media manifest writes one for you to fill in by hand, in a spreadsheet or with a script:
filenames a file by its name, or by as much of its path as tells it apart from the others.key, when present, sets the entry key of the file.- Every other column is a property of the source, named and read as in
occtoo sources import. Usetitle(en)for a value in one language. - An empty cell leaves a value as it is.
--set:
--set, and an empty value such as --set title= clears the property. The CLI checks everything before it sends the first file. A file that is already stored is not sent again, but still gets its properties.
media manifest writes CSV to stdout. The key column holds the entry key each file would get. Change it to give a file another key.
Show and delete assets
show prints the state and public address of each asset. delete removes assets and the files behind them. Both take a media source id and one or more entry keys.
Convert images
<name>-<preset>.<format>, or <name>-converted.<format> without a preset.
Conversion presets
A preset stores conversion parameters, so you can convert by name.create. paddingPercent and background are optional:
- Modes:
Fit,FillBackground(needspaddingPercent),Crop,Auto. - Formats:
Jpg,Png,Webp.
edit, both displayName and parameters are optional. When you give parameters, they replace all current parameters.