• MODX.com

    396 downloads

image64

image64 is an extra by demon.devin, first released on 2017-01-17.

Package Description

Converts a specified image to a base64 encoding.

Usage/Installation Instructions

PROPERTIES

----------

&alt       string   optional    What to display in the alt attribute

&img       string   required    path to desired image file

&css       boolean  required    if true will return just the data encoding. if false will return an img tag.

&extra     string   optional    specify any other attributes you'd like here. Example: data-user-attribute="something"

EXAMPLE 

For use within a css file or within <style></style> tags

background: url("[[!image64? &img=`img/php.png` &css=`true`]]") no-repeat left 2px;

Output:

background: url("data:image/png;base64,<!--BASE64 ENCODING HERE-->") no-repeat left 2px;

For use within an img tag

[[!image64? &img=`img/avatar.png` &alt=`demon.devin's Avatar`]]

Output:

<img src="data:image/png;base64,<!--BASE64 ENCODING HERE-->" alt="demon.devin's Avatar" />

With &extra=``

[[!image64? &img=`img/avatar.png` &extra=`title="demon.devin's Avatar" data-attr="user-image"`]]

Output:

<img src="data:image/png;base64,<!--BASE64 ENCODING HERE-->"" title="demon.devin's Avatar" data-attr="user-image" />

Details

Developer(s)
demon.devin
Released
2017-01-17
First seen
2017-01-17
License
GPLv2
Supported databases
MySQL
Minimum MODX Requirement
2.4

image64 Releases

Vendor Signature Released on
MODX.com 1.0.0-beta1 2017-01-17 (1 year ago)