Copyright © 2009-2021 Marc Worrell, David de Boer
Authors: Marc Worrell (marc@worrell.nl).
Generate media urls and html for viewing media, based on the filename, size and optional filters. Does not generate media previews itself, this is done when fetching the image.
Typical urls are like: /image/2007/03/31/wedding.jpg(300x300)(crop-center)(a3ab6605e5c8ce801ac77eb76289ac12).jpg /media/inline/2007/03/31/wedding.jpg /media/attachment/2007/03/31/wedding.jpgprops2url/2 | |
scomp_data_url/3 | Generate a 'data:' url for the given image. |
scomp_tag/3 | Called from template, render the media tag for some resource/medium. |
scomp_url/3 | Called from template, render the media url for some resource/medium. |
scomp_viewer/3 | Called from template, render the media viewer for some resource/medium. |
tag/3 | Generate a HTML image tag for the image with the filename and options. |
url/3 | Generate the url for the image with the filename and options. |
url2props/2 | Translate an url of the format "image.jpg(300x300)(crop-center)(checksum).jpg" to parts. |
viewer/3 | Generate a html fragment for displaying a medium. |
props2url(Props, Context) -> any()
scomp_data_url(IdOrName, Options, Context) -> any()
Generate a 'data:' url for the given image.
scomp_tag(IdOrName, Options, Context) -> any()
Called from template, render the media tag for some resource/medium
scomp_url(IdOrName, Options, Context) -> any()
Called from template, render the media url for some resource/medium
scomp_viewer(IdOrName, Options, Context) -> any()
Called from template, render the media viewer for some resource/medium
tag(MediaReference, Options::list(), Context::z:context()) -> {ok, iodata()}
Generate a HTML image tag for the image with the filename and options. The medium _must_ be in a format for which we can generate a preview. Note that this will never generate video or audio.
url(Name::MediaRef, Options, Context) -> {ok, Url::binary()} | {error, Reason}
Generate the url for the image with the filename and options
url2props(Url::binary() | string(), Context::z:context()) -> {ok, {FilePath::string(), Props::list(), Checksum::string(), ChecksumBaseString::string()}} | {error, no_lparen | checksum_invalid | extension_invalid | badarg}
Translate an url of the format "image.jpg(300x300)(crop-center)(checksum).jpg" to parts
viewer(MediaReference, Options::z_media_identify:media_info(), Context::z:context()) -> {ok, iodata()}
Generate a html fragment for displaying a medium. This can generate audio or video player html.
Generated by EDoc