This extension allows Brunsli.
Documentation for Brunsli can be found at » https://github.com/google/brunsli/.
% phpize
% ./configure --with-brunsli={DIR}
% make
$ make install
DIR: brunsli include and library directory
[DIR] |-- include | `-- brunsli | |-- decode.h | |-- encode.h | `-- types.h `-- lib |-- libbrunslidec-c.so `-- libbrunslienc-c.so
php.ini:
extension=brunsli.so
- brunsli_encode — Brunsli encodes a string
- brunsli_decode — Brunsli decodes a string
string brunsli_encode ( string $data )
This function brunsli encodes a string.
-
data
The JPEG data.
The brunsli encoded data or FALSE if an error occurred.
string brunsli_decode ( string $data )
This function brunsli decodes a string.
-
data
The Brunsli encodes data.
The brunsli decoded data (JPEG data) or FALSE if an error occurred.
/* encode */
$data = file_get_contents('brunsli.jpg'); /* load jpeg data */
$encode = brunsli_encode($data);
file_put_contents('output.brn', $encode); /* output brunsli encode data */
/* decode */
$data = file_get_contents('brunsli.jpg.brn'); /* load brunsli encode data */
$decode = brunsli_decode($data);
file_put_contents('output.jpg', $decode); /* output jpeg data */