Module z_media_tag

Generate media urls and html for viewing media, based on the filename, size and optional filters.

Copyright 2009-2012 Marc Worrell Date: 2009-03-03

Authors: Marc Worrell (marc@worrell.nl).

Description

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.jpg

Function Index

props2url/2
tag/3Generate a HTML image tag for the image with the filename and options.
url/3Generate the url for the image with the filename and options.
url2props/2Translate an url of the format "image.jpg(300x300)(crop-center)(checksum).jpg" to parts.
viewer/3Generate a html fragment for displaying a medium.

Function Details

props2url/2

props2url(Props, Context) -> any()

tag/3

tag(What::MediaReference, Options, Context) -> {ok, TagString} | {error, Reason}

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/3

url(Id::MediaRef, Options, Context) -> {ok, Url::binary()} | {error, Reason}

Generate the url for the image with the filename and options

url2props/2

url2props(Url, Context) -> {Filepath, PreviewPropList, Checksum, ChecksumBaseString} | error

Translate an url of the format "image.jpg(300x300)(crop-center)(checksum).jpg" to parts

viewer/3

viewer(Rsc_list::MediaReference, Options, Context) -> {ok, HtmlFragMent} | {error, Reason}

Generate a html fragment for displaying a medium. This can generate audio or video player html.


Generated by EDoc, Jul 29 2014, 16:41:15.