sunlabs.brazil.sunlabs
Class DataImageTemplate
java.lang.Object
sunlabs.brazil.template.Template
sunlabs.brazil.sunlabs.DataImageTemplate (view source)
- All Implemented Interfaces:
- TemplateInterface
public class DataImageTemplate
- extends Template
Template for including images inline, using data URL's.
Replaces:
<img src=foo.gif inline=true ...>
with
<img src=data:image/gif;base64,[base-64 encoded image data]" ...>
- cache=n
- The number of images to cache (defaults to 50).
- max=n
- The max size (in bytes) for images to inline.
- all=true
- Inline images if the "inline" tag is missing. If
"inline=false" is specified, the image is not inlined, even if
"all" is true.
- force=true
- Don't use the cached version of the image. This
is useful when an image is changed on disk. "force" updates the cache
entry (if any) with the new image.
| Fields inherited from class sunlabs.brazil.template.Template |
debug |
|
Method Summary |
boolean |
init(RewriteContext hr)
Initialize the cache (if any) on the first page load. |
void |
tag_img(RewriteContext hr)
Replace "src=xxx" with the "data" url equivalent, if appropriate. |
| Methods inherited from class sunlabs.brazil.template.Template |
done |
DataImageTemplate
public DataImageTemplate()
init
public boolean init(RewriteContext hr)
- Initialize the cache (if any) on the first page load.
- Specified by:
init in interface TemplateInterface- Overrides:
init in class Template
tag_img
public void tag_img(RewriteContext hr)
- Replace "src=xxx" with the "data" url equivalent, if appropriate.
Remove "inline" attribute, if present.