z_media_preview (zotonic_core v1.0.0-rc.11)
Link to this section Summary
Functions
Check if we can generate a preview image of the given mime type
Map filters to commandline options
Convert the Infile to an outfile with a still image using the filters.
Return the preferred mime type of the image generated by resizing an image of a certain type and size.
Determine the output mime type, after expanding optional mediaclass arguments.
Calculate the size of the resulting image.
Map the list of known filters and known args to atoms. Used when mapping preview urls back to filter args.
Link to this section Functions
Link to this function
calc_size(S)
Link to this function
can_generate_preview(B)
-spec can_generate_preview(binary() | string()) -> boolean().
Link to this function
cmd_args(FileProps, Filters, OutMime)
Link to this function
convert(InFile, OutFile, Filters, Context)
-spec convert(file:filename_all(), file:filename_all(), list(), #context{}) -> ok | {error, term()}.
Link to this function
convert(InFile, MediumFilename, OutFile, Filters, Context)
Link to this function
out_mime(InMime, Options)
-spec out_mime(InMime :: binary(), list()) -> {OutMime :: binary(), Extension :: string()}.
Link to this function
out_mime(Mime, Options, Context)
Link to this function
size(Props, Filters, Context)
Link to this function
string2filter(Filter, Where)
-spec string2filter(string(), string()) -> {ok, tuple() | atom()} | {error, term()}.