Skip to content

kjdev/php-ext-brunsli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Brunsli Extension for PHP

This extension allows Brunsli.

Documentation for Brunsli can be found at » https://github.com/google/brunsli/.

Build

% 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

Configuration

php.ini:

extension=brunsli.so

Function

  • brunsli_encode — Brunsli encodes a string
  • brunsli_decode — Brunsli decodes a string

brunsli_encode — Brunsli encodes a string

Description

string brunsli_encode ( string $data )

This function brunsli encodes a string.

Parameters

  • data

    The JPEG data.

Return Values

The brunsli encoded data or FALSE if an error occurred.


brunsli_decode — Brunsli decodes a string

Description

string brunsli_decode ( string $data )

This function brunsli decodes a string.

Parameters

  • data

    The Brunsli encodes data.

Return Values

The brunsli decoded data (JPEG data) or FALSE if an error occurred.

Examples

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

About

Brunsli Extension for PHP

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published