46 $this->originalFile = $sourceFile;
48 $this->source = $sourceFile ;
49 $this->destination = $destinationFile;
51 if(is_null($this->escapeChars) ){
52 $this->escapeChars = !( strtolower ( substr( php_uname(
's'), 0, 3)) ==
"win" ) ;
68 $this->source = str_replace(
' ',
'\ ',
$path) ;
79 $this->destination =
$path ;
84 if( ($this->destination ==
'')){
86 $ext = end (explode(
'.',
$source)) ;
87 $this->destinationFile = dirname(
$source) .
'/' . md5(microtime()) .
'.' . $ext;
98 $this->imageMagickPath = str_replace(
' ',
'\ ',
$path) ;
106 $this->imageQuality = intval($value);
120 return explode(
',', array_unique($this->history));
125 return array_unique($this->history) ;
132 $this->history[] =
$path ;
137 unset ($this->history);
138 $this->history = array();
144 if(key_exists($name, $this->loadedPlugins)) {
145 if(! is_null($version)) {
146 if( property_exists($this->loadedPlugins[$name],
'version') ){
147 if($this->loadedPlugins[$name]->version > $version)
150 if($this->debug)
throw new phMagickException (
'Plugin "'.$name.
'" version ='.$this->loadedPlugins[$name]->version .
' required >= ' . $version);
163 $base = dirname(__FILE__) .
'/plugins';
166 include_once $plugin ;
167 $name = basename($plugin,
'.php');
168 $className =
'phMagick_'.$name ;
169 $obj =
new $className();
170 $this->loadedPlugins[$name] = $obj ;
171 foreach (get_class_methods($obj) as $method )
172 $this->availableMethods[$method] = $name ;
182 if($this->escapeChars) {
183 $cmd= str_replace (
'(',
'\(',$cmd);
184 $cmd= str_replace (
')',
'\)',$cmd);
186 exec( $cmd .
' 2>&1', $out,
$ret);
189 if($this->debug) trigger_error (
new phMagickException (
'Error executing "'. $cmd.
'" <br>return code: '.
$ret .
' <br>command output :"'. implode(
"<br>", $out).
'"' ), E_USER_NOTICE );
191 $this->log[] = array(
201 if(! key_exists($method, $this->availableMethods))
202 throw new Exception (
'Call to undefined method : ' . $method);
204 array_unshift($args, $this);
205 $ret = call_user_func_array(array($this->loadedPlugins[$this->availableMethods[$method]], $method), $args);
208 throw new Exception (
'Error executing method "' . $method .
"'");
229 echo
'<br><b>phMagick</b>: ' . $message ;
330 $this->pGravity = $gravity;
335 $this->pText = $text;