Generators
A Generator creates content from nothing, e.g. text image generation, sine-wave audio generation for a given note, etc.
They work in exactly the same way as processors, except the content they receive is empty.
They can be added using a block or object that responds to call
Using the generator
Calling the generator on the app creates a new Job
object
Implementing the generator
Implementing is the same as for processors (including update_url
) - see Processors
and Dragonfly::Content.
Using shell commands
To generate using the shell, you can use Content#shell_generate
The yielded path
above will always exist.
Using pre-registered generators
To generate using a pre-registered generator, use Content#generate!
ImageMagick
The ImageMagick plugin adds a few generators - see the doc for more details.
If you’re defining a new generator you can make use of the generate
command in Dragonfly::ImageMagick::Commands
, e.g.
which corresponds to the command-line
convert -size 100x100 gradient:blue <path>
where path has extension ‘jpg’ (optional argument).
Derived from theme by orderedlist