This repository has been archived by the owner on Mar 29, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathREADME
executable file
·105 lines (66 loc) · 2.39 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
PHP Image Transformation Library - Pitlib
http://cbrunet.net/pitlib
- a fork from Asido
Version 0.3.0 alpha
By Charles Brunet <[email protected]>
== INSTALLATION ==
You only need files located into lib/ directory.
Copy them somewhere accessible from your PHP script.
To use Pitlib, simply include Pitlib.php file into your code, e.g.:
require_once 'Pitlib.php';
You will need some additional programs or libraries to use some Pitlib drivers.
On Debian/Ubuntu, you need:
* php5-gd : for 'gd' driver;
* netpbm : for 'netpbm' driver;
* php5-imagick : for 'imagick_ext' driver;
* imagemagick : for 'imagick_shell' driver;
* graphicsmagick : for 'gmagick_shell' driver;
* php-imlib : for 'imlib2' driver. You will also need to load it in php.ini;
For 'magickwand' driver, see below...
== USING PITLIB ==
Example 1: simple image conversion
<?php
// include Pitlib library
require_once 'Pitlib.php';
try {
// load 'gd' driver.
// Calling Pitlib::driver (); would try to find best available driver.
Pitlib::driver ('gd');
// Load source image and set target destination
$image = Pitlib::image ('source.jpg');
// Perform the operation
$image->save ('target.png', Pitlib::OVERWRITE_ENABLED);
}
catch (Pitlib_Exception $e) {
echo $e->getMessage ();
}
?>
== GENERATION DOC ==
To generate API documentation, you need PhpDocumentor. More info at http://www.phpdoc.org
To install PhpDocumentor, you just need to use PEAR
$ pear install PhpDocumentor
To generate documentation, type
$ phpdoc -c doc/default.ini
== TESTING ==
To know what drivers are available on you system, run
$ php Test/driver.php
To run test suite, you will need an installation of PHPUnit.
The easiest way to install PHPUnit is using pear.
$ pear channel-discover pear.phpunit.de
$ pear install phpunit/PHPUnit
To run test suite, simple do
phpunit Test/phpunit/AllTests.php
from within Pitlib directory. Some tests cannot be executed if specific
drivers cannot be loaded.
== INSTALLING MagickWand ON UBUNTU ==
$ sudo aptitude install subversion php5-dev imagemagick php5-imagick libmagick9-dev
$ svn co https://www.imagemagick.org/subversion/MagickWandForPHP/branches/MagickWandForPHP-1.0.8 MagickWandForPHP-1.0.8
$ cd MagickWandForPHP-1.0.8
$ phpize
$ autoconf
$ ./configure
$ make
$ sudo make install
Create file /etc/php5/cond.d/magickwand.ini:
extension=magickwand.so
Restart apache2