FAQ (Frequently Asked Questions)
for PHP developers on using WSQ image library





How to use WSQ image library in PHP?

Linux version:

PHP cannot directly load and use standard shared libraries (*.so).

PHP needs special wrapper library called "PHP extension", which works like following:

WSQ image library <-> PHP extension <-> PHP program

Such a wrapper interface ("PHP extension") is provided in shared library file "wsq.so":

libWSQ_library.so <-> wsq.so <-> PHP program

Windows version:

PHP cannot directly load and use standard Dynamic-link libraries (*.dll).

PHP needs special wrapper library called "PHP extension", which works like following:

WSQ image library <-> PHP extension <-> PHP program

Such a wrapper interface ("PHP extension") is provided in Dynamic-link library file "php_wsq.dll":

WSQ_library.dll <-> php_wsq.dll <-> PHP program




How to install WSQ image library "PHP extension"?

Installation instructions of WSQ "PHP extension" are below.

PHP 7 version (Linux)

Below are instructions for Ubuntu 16.04 running PHP 7.0.33.
Your system might need slight modifications of these instructions.

1.

Install Apache2 using following commands:

  
sudo apt-get update

sudo apt-get upgrade

sudo apt-get install apache2 -y


2.

Install PHP using following commands:

  
sudo apt-get install libapache2-mod-php

sudo apt-get install php-dev


3.

To verify if PHP is installed, run the following command:

  
php -v


4.

Start Apache2 using following command:

  
sudo systemctl start apache2.service


5.

You can skip this step. This step is only needed in case if you want to fix and recompile the source code of WSQ PHP extension using Linux GNU C compiler.

Download PHP 4/5/7 source code of "WSQ PHP extension" by clicking here

Compile WSQ PHP extension using following command:

  
sudo ./build_wsq_php_extension.sh

(file "build_wsq_php_extension.sh" is located inside directory "WSQ_PHP_extension_Linux")

6.

Copy file "wsq.ini" to directories:

(for online website usage)

  
/etc/php/7.0/apache2/conf.d

(for execution of PHP scripts using command line)

  
/etc/php/7.0/cli/conf.d

The contents of "wsq.ini" file is one line only:

  
extension=wsq.so


7.

In case of 64-bit Linux copy file "libWSQ_library64.so" from subdirectory "Linux64" to directory:

  
"/usr/lib/"

In case of 32-bit Linux copy file "libWSQ_library.so" from subdirectory "Linux32" to directory:

  
"/usr/lib/"


8.

Copy *.php files to default root folder of the web server.

The default document root for Apache is

  
/var/www/ (before Ubuntu 14.04)
or
/var/www/html/ (Ubuntu 14.04 and later).

Copy "phpinfo.php" file to default root folder of the web server.

9.

Find IP address for the apache2 server.

This command prints both IPv4 and IPv6 address of the currently active interface:

  
hostname -I


10.

In web browser run "phpinfo.php" script using IP address for the apache2 server.

As for example:

  
http://192.168.22.130/phpinfo.php

which shows you PHP configuration of your server, like for example:

  
Loaded Configuration File
/etc/php/7.0/apache2/php.ini

Scan this dir for additional .ini files	
/etc/php/7.0/apache2/conf.d

extension_dir
/usr/lib/php/20151012


11.

In PHP configuration table find the current value of:

  
extension_dir

As for example, "extension_dir" might be:

  
/usr/lib/php/20151012


12.

Copy file "wsq.so" from subdirectory:

"Linux32" or "Linux64" (or from subdirectory "PHP_extension_PHP_7_0_33/modules" if recompiling the source code of WSQ PHP extension)

to "extension_dir" directory

  
/usr/lib/php/20151012


13.

Restart Apache2 using following command:

sudo systemctl restart apache2.service

14.

Running PHP script from the command line.

To parse PHP script file and output to console:

php -f file.php

As for example:

  
php -f wsq_convert_image.php
php -f wsq_read_image_from_file.php
php -f wsq_save_image_to_file.php
php -f wsq_decode_stream.php
php -f wsq_encode_stream.php


15.

Running PHP script from web browser.

Use IP address of the apache2 server and add php filename:

As for example:

  
http://192.168.22.130/wsq_read_image_from_file.php
http://192.168.22.130/wsq_save_image_to_file.php
http://192.168.22.130/wsq_convert_image.php
http://192.168.22.130/wsq_decode_stream.php
http://192.168.22.130/wsq_encode_stream.php




PHP 5 version (Linux)

Below are instructions for Ubuntu 12.04.5 running PHP 5.3.10.
Your system might need slight modifications of these instructions.

1.

Install LAMP (Linux Apache MySQL PHP) with following commands:

  
sudo apt-get update

sudo apt-get upgrade

sudo apt-get install lamp-server^ phpmyadmin

This one line command tells Ubuntu to install lamp-server and phpmyadmin ( ^ means using tasksel), lamp-server is a set of applications to fully install apache, MySQL and php and set it up.
This code does it all, then just follow the instructions:
(1) Confirm the download with yes.
(2) Setup the MySQL root password (if you have a public server it is a must), then you will be asked, if you want to configure Apache or Lighthttpd, please choose Apache.
(3) The phpmyadmin package must have a database installed and configured before it can be used. This can be optionally handled with dbconfig-common.
(4) You will be then asked to set a phpmyadmin password with MySQL. If you will leave it blank, then random password will be generated.

Entering http://localhost/phpmyadmin or http://your.public.ip.address/phpmyadmin should be working now and you must be able to log in entering your root credentials, user: root, password: root password you entered in second step.


2.

Install PHP using following commands:

  
sudo apt-get install php5-dev


3.

To verify if PHP is installed, run the following command:

  
php -v


4.

Start Apache2 using following command:

  
sudo systemctl start apache2.service


5.

You can skip this step. This step is only needed in case if you want to fix and recompile the source code of WSQ PHP extension using Linux GNU C compiler.

Download PHP 4/5/7 source code of "WSQ PHP extension" by clicking here

Compile WSQ PHP extension using following command:

  
sudo ./build_wsq_php_extension.sh

(file "build_wsq_php_extension.sh" is located inside directory "WSQ_PHP_extension_Linux")

6.

Copy file "wsq.ini" to directories:

(for online website usage)

  
/etc/php5/apache2/conf.d

(for execution of PHP scripts using command line)

  
/etc/php5/cli/conf.d
  
/etc/php5/conf.d
/etc/php.d

The contents of "wsq.ini" file is one line only:

  
extension=wsq.so


7.

In case of 64-bit Linux copy file "libWSQ_library64.so" from subdirectory "Linux64" to directory:

  
"/usr/lib/"

In case of 32-bit Linux copy file "libWSQ_library.so" from subdirectory "Linux32" to directory:

  
"/usr/lib/"


8.

Copy *.php files to default root folder of the web server.

The default document root for Apache is

  
/var/www/ (before Ubuntu 14.04)
or
/var/www/html/ (Ubuntu 14.04 and later).

Copy "phpinfo.php" file to default root folder of the web server.

9.

Find IP address for the apache2 server.

This command prints both IPv4 and IPv6 address of the currently active interface:

  
hostname -I


10.

In web browser run "phpinfo.php" script using IP address for the apache2 server.

As for example:

  
http://192.168.22.130/phpinfo.php

which shows you PHP configuration of your server, like for example:

  
Loaded Configuration File
/etc/php5/apache2/php.ini 

Scan this dir for additional .ini files	
/etc/php5/apache2/conf.d

extension_dir
/usr/lib/php/20151012


11.

In PHP configuration table find the current value of:

  
extension_dir

As for example, "extension_dir" might be:

  
/usr/lib/php5/20090626


12.

Copy file "wsq.so" from subdirectory:

"Linux32" or "Linux64" (or from subdirectory "WSQ_PHP_extension_Linux/modules" if recompiling the source code of WSQ PHP extension)

to "extension_dir" directory

  
/usr/lib/php5/20090626


13.

Restart Apache2 using following command:

sudo systemctl restart apache2.service

14.

Running PHP script from the command line.

To parse PHP script file and output to console:

php -f file.php

As for example:

  
php -f wsq_convert_image.php
php -f wsq_read_image_from_file.php
php -f wsq_save_image_to_file.php
php -f wsq_decode_stream.php
php -f wsq_encode_stream.php


15.

Running PHP script from web browser.

Use IP address of the apache2 server and add php filename:

As for example:

  
http://192.168.22.130/wsq_read_image_from_file.php
http://192.168.22.130/wsq_save_image_to_file.php
http://192.168.22.130/wsq_convert_image.php
http://192.168.22.130/wsq_decode_stream.php
http://192.168.22.130/wsq_encode_stream.php




PHP 4 version (Linux)

Below are instructions for Ubuntu 12.04.5 running PHP 4.4.9.
Your system might need slight modifications of these instructions.

1.

Install Apache with following command:

  
sudo apt-get update

sudo apt-get upgrade

sudo apt-get install apache2


2.

Install PHP4 with following commands:

  
(install dependencies for PHP4)
sudo apt-get install build-essential flex bison libicu-dev libxml2-dev

wget http://uk.php.net/distributions/php-4.4.9.tar.gz

tar zxf php-4.4.9.tar.gz
cd php-4.4.9/
./configure
make
sudo make install


3.

To verify if PHP is installed, run the following command:

  
php -v


4.

Start Apache2 using following command:

  
Start Apache 2 Server
sudo /etc/init.d/apache2 start

Restart Apache 2 Server
sudo /etc/init.d/apache2 restart

Stop Apache 2 Server
sudo /etc/init.d/apache2 stop


5.

You can skip this step. This step is only needed in case if you want to fix and recompile the source code of WSQ PHP extension using Linux GNU C compiler.

Download PHP 4/5/7 source code of "WSQ PHP extension" by clicking here

You may need to install autoconf.
For Ubuntu use the following command:

  
sudo apt-get install autoconf

Compile WSQ PHP extension using following command:

  
sudo ./build_wsq_php_extension.sh

(file "build_wsq_php_extension.sh" is located inside directory "WSQ_PHP_extension_Linux")

6.

Setup your php.ini file:

  
cp php.ini-dist /usr/local/lib/php.ini

Edit in /usr/local/lib/php.ini

  
extension=wsq.so
;wsq.library_location=/path/to/libWSQ_library.so

; Directory in which the loadable extensions (modules) reside.
extension_dir = "/path/to/wsq.so"

like for example:
extension_dir = "/usr/local/lib/php/extensions/no-debug-non-zts-20020429/"


7.

In case of 64-bit Linux copy file "libWSQ_library64.so" from subdirectory "Linux64" to directory:

  
"/usr/lib/"

In case of 32-bit Linux copy file "libWSQ_library.so" from subdirectory "Linux32" to directory:

  
"/usr/lib/"


8.

Copy *.php files to default root folder of the web server.

The default document root for Apache is

  
/var/www/ (before Ubuntu 14.04)
or
/var/www/html/ (Ubuntu 14.04 and later).

Copy "phpinfo.php" file to default root folder of the web server.

9.

Find IP address for the apache2 server.

This command prints both IPv4 and IPv6 address of the currently active interface:

  
hostname -I


10.

Find the location of the currently loaded php.ini file using following command:

  
php -i |grep php.ini

or alternatively:

In web browser run "phpinfo.php" script using IP address for the apache2 server.

As for example:

  
http://192.168.22.130/phpinfo.php

which shows you PHP configuration of your server, like for example:

  
Loaded Configuration File
/usr/local/lib/php.ini

extension_dir
/usr/local/lib/php/extensions/no-debug-non-zts-20020429/


11.

Find extension_dir location using following command:

  
php -i | grep extension_dir

or alternatively:

In PHP configuration table find the current value of:

  
extension_dir

As for example, "extension_dir" might be:

  
/usr/lib/php5/20090626


12.

Copy file "wsq.so" from subdirectory:

"Linux32" or "Linux64" (or from subdirectory "WSQ_PHP_extension_Linux/modules" if recompiling the source code of WSQ PHP extension)

to "extension_dir" directory

  
/usr/lib/php5/20090626


13.

Restart Apache2 using following command:

sudo /etc/init.d/apache2 restart

14.

Running PHP script from the command line.

To parse PHP script file and output to console:

php -f file.php

As for example:

  
php -f wsq_convert_image.php
php -f wsq_read_image_from_file.php
php -f wsq_save_image_to_file.php
php -f wsq_decode_stream.php
php -f wsq_encode_stream.php


15.

Running PHP script from web browser.

Use IP address of the apache2 server and add php filename:

As for example:

  
http://192.168.22.130/wsq_read_image_from_file.php
http://192.168.22.130/wsq_save_image_to_file.php
http://192.168.22.130/wsq_convert_image.php
http://192.168.22.130/wsq_decode_stream.php
http://192.168.22.130/wsq_encode_stream.php





PHP 7 version (Windows)

Below are instructions for Windows 10 (64-bit) running PHP 7.2.16 and Visual Studio 2017.

Your system might need slight modifications of these instructions.

To build PHP extension on Windows you will need:

(1) Download PHP 4/5/7 source code of "WSQ PHP extension" by clicking here.

(2) Microsoft Visual C++ compiler.

https://wiki.php.net/internals/windows/stepbystepbuild_sdk_2

PHP officially supports building with Microsoft's Visual C++ compilers. MinGW and Cygwin are NOT supported. ICC and clang can be used for experimental purposes.

Though, be aware, the production quality binaries are guaranteed only by using Visual C++.

The freely available Community VC++ editions are fully supported and can be used.

The following VC++ versions are supported:

Visual C++ 14.0 (Visual Studio 2015) for PHP 7.0 or PHP 7.1.

Visual C++ 15.0 (Visual Studio 2017) for PHP 7.2 or PHP 7.3.

For more information and how to get the compiler see the supported versions.

https://wiki.php.net/internals/windows/compiler

Supported compilers to build PHP on Windows

(3) PHP source code, which you can download from:

http://windows.php.net/download/

(4) latest stable SDK binary tools, which you can download from:

https://github.com/Microsoft/php-sdk-binary-tools

https://wiki.php.net/internals/windows/stepbystepbuild_sdk_2

Please download and extract the file to directory:

  
C:\php-sdk



In order to compile PHP extension, you will need:

1.

https://wiki.php.net/internals/windows/stepbystepbuild_sdk_2

Invoke the starter script to automatically setup the environment for the desired build config, as for example:

  
cd C:\php-sdk
phpsdk-vc15-x64.bat
(for VS 2017)



2.

Change current directory to PHP source code directory:

  
cd C:\php-7.2.16


3.

Setup directory of PHP modules using the following command:

  
buildconf.bat --add-modules-dir=C:\PHP\

"C:\PHP\" is the directory where source code of PHP extensions is located.

4.

Run the following command:

  
configure.bat --disable-all --enable-cli --enable-wsq=shared --disable-zts

By default, this it creates a “Thread Safe” build. If you want a non thread safe build, just add --disable-zts to the command line.

5.

To build, run the following command:

  
nmake

This will build WSQ PHP extension, as well as php.exe.

This is handy because you’ll need a php.exe that matches the configuration of your extension.

In order to be loaded in PHP, your extension must match the PHP build in term of:

--word size (32 or 64 bits)

--thread safety (TS build or NTS build)

--compiler version (VS9, VS11 etc.)

If you don’t need to build php.exe, then you can use following command to compile only WSQ PHP extension:

  
nmake php_wsq.dll

The compiled WSQ PHP extension will be located like this:

  
C:\php-7.2.16\x64\Release\php_wsq.dll

In order to run PHP extension, you will need:

6.

Copy "php.ini" file to

  
C:\Windows\


7.

Add php.exe location to PATH like this:

  
PATH=%PATH%;C:\php-7.2.16\x64\Release\


8.

Copy files "WSQ_library64.dll" and/or "WSQ_library.dll" to PATH.

As for example, copy files "WSQ_library64.dll" and/or "WSQ_library.dll" to:

  
C:\php-7.2.16\x64\Release


9.

Check PHP version with the following command:

  
php -v

Check the location of PHP extensions using the following command:

  
php -i

extension_dir => C:\php\ext => C:\php\ext


10.

Copy "php_wsq.dll" file from:

  
C:\php-7.2.16\x64\Release\php_wsq.dll

to:

  
C:\php\ext\php_wsq.dll

Otherwise you will get error message like this:

  
PHP Warning:  PHP Startup: Unable to load dynamic library 'wsq' 
(tried: C:\php\ext\wsq (The specified module could not be found.), C:\php\ext\php_wsq.dll (The specified module could not be found.)) in Unknown on line 0


11.

Running PHP script from the command line.

To parse PHP script file and output to console:

  
php -f file.php

As for example:

  
php -f wsq_convert_image.php
php -f wsq_read_image_from_file.php
php -f wsq_save_image_to_file.php
php -f wsq_decode_stream.php
php -f wsq_encode_stream.php


12.

Starts built-in web server. Available as of PHP 5.4.0.

  
php -S localhost:8000

Enter in web browser:

  
http://localhost:8000/wsq_convert_image.php.php
http://localhost:8000/wsq_read_image_from_file.php
http://localhost:8000/wsq_save_image_to_file.php
http://localhost:8000/wsq_decode_stream.php
http://localhost:8000/wsq_encode_stream.php


13.

Running PHP script from web browser.

Use IP address of the apache2 server and add php filename:

As for example:

  
http://192.168.22.130/wsq_read_image_from_file.php
http://192.168.22.130/wsq_save_image_to_file.php
http://192.168.22.130/wsq_convert_image.php
http://192.168.22.130/wsq_decode_stream.php
http://192.168.22.130/wsq_encode_stream.php



Additional helpful info:

https://wiki.php.net/internals/windows/stepbystepbuild_sdk_2

  
Recompile after you have done some changes
Clean up old compiled binaries
nmake clean

If you need to update the 'configure' script
buildconf --force

Create your makefile: see release
configure --disable-all --enable-cli --enable-$remains

Compile
nmake

https://blog.benoitblanchon.fr/build-php-extension-on-windows/

[PHP] Compile an extension on Windows

20 January 2015




PHP 5 version (Windows)

Below are instructions for Windows 7 (64-bit) running PHP 5.6.40 and Visual Studio 2012.

Your system might need slight modifications of these instructions.

To build PHP extension on Windows you will need:

(1) Download PHP 4/5/7 source code of "WSQ PHP extension" by clicking here.

(2) Microsoft Visual C++ compiler.

https://wiki.php.net/internals/windows/stepbystepbuild_sdk_2

PHP officially supports building with Microsoft's Visual C++ compilers. MinGW and Cygwin are NOT supported. ICC and clang can be used for experimental purposes.

Though, be aware, the production quality binaries are guaranteed only by using Visual C++.

The freely available Community VC++ editions are fully supported and can be used.

For more information and how to get the compiler see the supported versions.

https://wiki.php.net/internals/windows/compiler

Supported compilers to build PHP on Windows

Visual C++ 11 (2012) for PHP 5.6.x

(3) PHP source code, which you can download from:

https://windows.php.net/downloads/releases/archives/php-5.6.40-src.zip

Please download and extract the file to directory:

  
C:\php-5.6.40-src



In order to compile PHP extension, you will need:

1.

Download PHP 5.6.40 source code from the address:

https://windows.php.net/downloads/releases/archives/php-5.6.40-src.zip

2.

Copy files extracted from file
"WSQ_PHP_extension_Windows.zip"

to directory

  
"C:\php-5.6.40-src\ext\wsq"


3.

Download bison.exe file from the address:
http://gnuwin32.sourceforge.net/downlinks/bison-bin-zip.php

Download flex.exe file from the address:
http://gnuwin32.sourceforge.net/downlinks/flex-bin-zip.php

Download gnuwin32 from the address:
http://gnuwin32.sourceforge.net/downlinks/make-dep-zip.php

Download Regex for Windows from the address:
http://gnuwin32.sourceforge.net/downlinks/regex-bin-zip.php

Open archive files and go into their "bin" subdirectories.

Copy file "flex.exe" from "flex-2.5.4a-1-bin\bin" into "C:\php-5.6.40-src\"

Copy files "libiconv2.dll" and "libintl3.dll" from "make-3.81-dep\bin" into "C:\php-5.6.40-src\"

Copy file "regex2.dll" from "regex-2.7-bin\bin" into "C:\php-5.6.40-src\"

Copy files "bison.exe" and "m4.exe" and "yacc" from "bison-2.4.1-bin\bin" into "C:\php-5.6.40-src\"

Copy subdirectory "share" from

"bison-2.4.1-bin\share\

to directory

  
"C:\Program Files\bison\share\"


4.

Please use
"Visual Studio 2012 Native Tools Command Prompt"
because the standard Windows "command prompt" will not work.

5.

Add php.exe location to PATH like this:

  
PATH=%PATH%;C:\php-5.6.40-src


6.

  
cd C:\php-5.6.40-src


7.

Run the buildconf.bat file with the --force argument:

  
buildconf.bat --force

This will generate a new configure.bat file which will have the configuration of your PHP build.

8.

Run configure.bat with the following command and enable WSQ extension using the --enable- argument.

In our case, the extension is WSQ and the source code is in the "C:\php-5.6.40-src\ext\wsq" directory.

Run the command to configure it:

  
configure.bat --disable-all --enable-cli --enable-wsq=shared --disable-zts

By default, this it creates a “Thread Safe” build. If you want a non thread safe build, just add --disable-zts to the command line.

9.

To build, run the following command:

  
nmake

This will build WSQ PHP extension, as well as php.exe.

This is handy because you’ll need a php.exe that matches the configuration of your extension.

In order to be loaded in PHP, your extension must match the PHP build in term of:

--word size (32 or 64 bits)

--thread safety (TS build or NTS build)

--compiler version (VS9, VS11 etc.)

The compiled WSQ PHP extension will be located like this:

  
C:\php-5.6.40-src\Release\php_wsq.dll

In order to run PHP extension, you will need:

10.

Copy "php.ini" file to

  
C:\Windows\


11.

Add php.exe location to PATH like this:

  
PATH=%PATH%;C:\php-5.6.40-src\Release


12.

Copy files "WSQ_library64.dll" and/or "WSQ_library.dll" to PATH.

As for example, copy files "WSQ_library64.dll" and/or "WSQ_library.dll" to:

  
C:\php-5.6.40-src\Release


13.

Check PHP version with the following command:

  
php -v

Check the location of PHP extensions using the following command:

  
php -i

extension_dir => C:\php-5.6.40-src\Release\ext => C:\php-5.6.40-src\Release\ext


14.

Copy "php_wsq.dll" file from:

  
C:\php-5.6.40-src\Release\php_wsq.dll

to:

  
C:\php\ext\php_wsq.dll

Otherwise you will get error message like this:

  
PHP Warning:  PHP Startup: Unable to load dynamic library 'C:\php\ext\php_wsq.dll' - The specified module could not be found. in Unknown on line 0


15. Go to sample project directory:

  
cd C:\WSQ_PHP4_PHP5_PHP7


16.

Running PHP script from the command line.

To parse PHP script file and output to console:

  
php -f file.php

As for example:

  
php -f wsq_convert_image.php
php -f wsq_read_image_from_file.php
php -f wsq_save_image_to_file.php
php -f wsq_decode_stream.php
php -f wsq_encode_stream.php


17.

Starts built-in web server. Available as of PHP 5.4.0.

  
php -S localhost:8000

Enter in web browser:

  
http://localhost:8000/wsq_convert_image.php.php
http://localhost:8000/wsq_read_image_from_file.php
http://localhost:8000/wsq_save_image_to_file.php
http://localhost:8000/wsq_decode_stream.php
http://localhost:8000/wsq_encode_stream.php


18.

Running PHP script from web browser.

Use IP address of the apache2 server and add php filename:

As for example:

  
http://192.168.22.130/wsq_read_image_from_file.php
http://192.168.22.130/wsq_save_image_to_file.php
http://192.168.22.130/wsq_convert_image.php
http://192.168.22.130/wsq_decode_stream.php
http://192.168.22.130/wsq_encode_stream.php



Additional helpful info:

https://wiki.php.net/internals/windows/stepbystepbuild_sdk_2

  
Recompile after you have done some changes
Clean up old compiled binaries
nmake clean

If you need to update the 'configure' script
buildconf --force

Create your makefile: see release
configure --disable-all --enable-cli --enable-$remains

Compile
nmake

https://blog.benoitblanchon.fr/build-php-extension-on-windows/

[PHP] Compile an extension on Windows

20 January 2015








How to call and use WSQ image library functions in PHP?

Names of the functions in "PHP extension" are slightly different from names in WSQ image library.

They are listed in the table below.

Table 1 Names of PHP functions in "PHP extension"

Name of PHP function Original name of function in WSQ image library
wsq_convert_image
(available only in PHP extension)
wsq_read_image_from_fileint ReadImageFromFile(const char* fileName, int* width, int* height, unsigned char** imageData)
wsq_save_image_to_fileint SaveImageToFile(const char* fileName, int filetype, int width, int height, unsigned char* imageData)
wsq_generate_serial_numberchar* GenerateSerialNumber()
wsq_unlock_wsq_libraryint UnlockWSQLibrary(char* authorization_code)
wsq_write_wsq_bitratevoid WriteWSQ_bitrate(double bitrate)
wsq_read_wsq_bitratedouble ReadWSQ_bitrate()
wsq_write_wsq_ppivoid WriteWSQ_ppi(int ppi)
wsq_read_wsq_ppiint ReadWSQ_ppi()
wsq_write_wsq_commentvoid WriteWSQ_comment(char *comment)
wsq_read_wsq_commentchar* ReadWSQ_comment()
wsq_write_tiff_compressionvoid WriteTIFFcompression(int tiff_compression)
wsq_write_tiff_predictorvoid WriteTIFFpredictor(int tiff_predictor)
wsq_decode_streamint WSQ_decode_stream(unsigned char *input_data_stream, const int input_stream_length, unsigned char **output_data_stream, int *width, int *height, int *ppi, unsigned char **comment_text)
wsq_encode_streamint WSQ_encode_stream(unsigned char *input_data_stream, const int width, const int height, const double bitrate, const int ppi, char *comment_text, unsigned char **output_data_stream, int *output_stream_length)



For more details about how to use PHP functions please see the files

  
wsq_convert_image.php,
wsq_read_image_from_file.php,
wsq_save_image_to_file.php,
wsq_decode_stream.php,
wsq_encode_stream.php

in Linux PHP 4/5/7 sample project

in Windows PHP 4/5/7 sample project

Please do not forget to set file permissions for *.php and *.so files.







Copyright ©2024 Cognaxon. All rights reserved. Privacy