Applied fixes from StyleCI
This commit is contained in:

committed by
StyleCI Bot

parent
500a2d76f4
commit
56bc64132b
@@ -15,7 +15,7 @@ use Exception;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* CannedController.
|
* CannedController.
|
||||||
*
|
*
|
||||||
* This controller is for all the functionalities of Canned response for Agents in the Agent Panel
|
* This controller is for all the functionalities of Canned response for Agents in the Agent Panel
|
||||||
*
|
*
|
||||||
* @author Ladybird <info@ladybirdweb.com>
|
* @author Ladybird <info@ladybirdweb.com>
|
||||||
|
@@ -15,7 +15,7 @@ use View;
|
|||||||
/**
|
/**
|
||||||
* DashboardController
|
* DashboardController
|
||||||
* This controlleris used to fetch dashboard in the agent panel.
|
* This controlleris used to fetch dashboard in the agent panel.
|
||||||
*
|
*
|
||||||
* @author Ladybird <info@ladybirdweb.com>
|
* @author Ladybird <info@ladybirdweb.com>
|
||||||
*/
|
*/
|
||||||
class DashboardController extends Controller
|
class DashboardController extends Controller
|
||||||
|
@@ -11,6 +11,7 @@ use App\Model\helpdesk\Settings\Company;
|
|||||||
use App\Model\helpdesk\settings\Email;
|
use App\Model\helpdesk\settings\Email;
|
||||||
use App\Model\helpdesk\Utility\Log_notification;
|
use App\Model\helpdesk\Utility\Log_notification;
|
||||||
use App\User;
|
use App\User;
|
||||||
|
|
||||||
// classes
|
// classes
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -3,7 +3,8 @@
|
|||||||
namespace App\Http\Controllers\Agent\helpdesk;
|
namespace App\Http\Controllers\Agent\helpdesk;
|
||||||
|
|
||||||
// controllers
|
// controllers
|
||||||
use App\Http\Controllers\Common\SettingsController;use App\Http\Controllers\Controller;
|
use App\Http\Controllers\Common\SettingsController;
|
||||||
|
use App\Http\Controllers\Controller;
|
||||||
// requests
|
// requests
|
||||||
// models
|
// models
|
||||||
use App\Model\helpdesk\Agent\Department;
|
use App\Model\helpdesk\Agent\Department;
|
||||||
|
@@ -2533,7 +2533,7 @@ class TicketController extends Controller
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* useradd.
|
* useradd.
|
||||||
*
|
*
|
||||||
* @param type Image $image
|
* @param type Image $image
|
||||||
|
@@ -4,7 +4,6 @@ namespace App\Http\Controllers\Agent\kb;
|
|||||||
|
|
||||||
// Controllers
|
// Controllers
|
||||||
use App\Http\Controllers\Agent\helpdesk\TicketController;
|
use App\Http\Controllers\Agent\helpdesk\TicketController;
|
||||||
|
|
||||||
use App\Http\Controllers\Controller;
|
use App\Http\Controllers\Controller;
|
||||||
// Requests
|
// Requests
|
||||||
use App\Http\Requests\kb\ArticleRequest;
|
use App\Http\Requests\kb\ArticleRequest;
|
||||||
|
@@ -23,8 +23,8 @@ use Illuminate\Http\Request;
|
|||||||
* -----------------------------------------------------------------------------
|
* -----------------------------------------------------------------------------
|
||||||
* Api Controller
|
* Api Controller
|
||||||
* -----------------------------------------------------------------------------.
|
* -----------------------------------------------------------------------------.
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* @author Vijay Sebastian <vijay.sebastian@ladybirdweb.com>
|
* @author Vijay Sebastian <vijay.sebastian@ladybirdweb.com>
|
||||||
* @copyright (c) 2016, Ladybird Web Solution
|
* @copyright (c) 2016, Ladybird Web Solution
|
||||||
* @name Faveo HELPDESK
|
* @name Faveo HELPDESK
|
||||||
@@ -723,7 +723,7 @@ class ApiController extends Controller
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* To generate api string.
|
* To generate api string.
|
||||||
*
|
*
|
||||||
* @return type | json
|
* @return type | json
|
||||||
*/
|
*/
|
||||||
public function generateApiKey()
|
public function generateApiKey()
|
||||||
|
@@ -22,8 +22,8 @@ use Mail;
|
|||||||
* -----------------------------------------------------------------------------
|
* -----------------------------------------------------------------------------
|
||||||
* Ticket Controller
|
* Ticket Controller
|
||||||
* -----------------------------------------------------------------------------.
|
* -----------------------------------------------------------------------------.
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* @author Vijay Sebastian <vijay.sebastian@ladybirdweb.com>
|
* @author Vijay Sebastian <vijay.sebastian@ladybirdweb.com>
|
||||||
* @copyright (c) 2016, Ladybird Web Solution
|
* @copyright (c) 2016, Ladybird Web Solution
|
||||||
* @name Faveo HELPDESK
|
* @name Faveo HELPDESK
|
||||||
|
@@ -13,8 +13,8 @@ use Tymon\JWTAuth\Exceptions\JWTException;
|
|||||||
* -----------------------------------------------------------------------------
|
* -----------------------------------------------------------------------------
|
||||||
* Token authenticate Controller
|
* Token authenticate Controller
|
||||||
* -----------------------------------------------------------------------------.
|
* -----------------------------------------------------------------------------.
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* @author Vijay Sebastian <vijay.sebastian@ladybirdweb.com>
|
* @author Vijay Sebastian <vijay.sebastian@ladybirdweb.com>
|
||||||
* @copyright (c) 2016, Ladybird Web Solution
|
* @copyright (c) 2016, Ladybird Web Solution
|
||||||
* @name Faveo HELPDESK
|
* @name Faveo HELPDESK
|
||||||
|
@@ -6,6 +6,7 @@ namespace App\Http\Controllers\Client\helpdesk;
|
|||||||
use App\Http\Controllers\Controller;
|
use App\Http\Controllers\Controller;
|
||||||
// models
|
// models
|
||||||
use App\Model\helpdesk\Email\Emails;
|
use App\Model\helpdesk\Email\Emails;
|
||||||
|
|
||||||
// classes
|
// classes
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -71,7 +71,7 @@ class InstallController extends Controller
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Get prerequisites (step 2).
|
* Get prerequisites (step 2).
|
||||||
*
|
*
|
||||||
* Checking the extensions enabled required for installing the faveo
|
* Checking the extensions enabled required for installing the faveo
|
||||||
* without which the project cannot be executed properly
|
* without which the project cannot be executed properly
|
||||||
*
|
*
|
||||||
|
@@ -3,6 +3,7 @@
|
|||||||
namespace App\Model\helpdesk\Ticket;
|
namespace App\Model\helpdesk\Ticket;
|
||||||
|
|
||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
|
||||||
class Ticket_Thread extends Model
|
class Ticket_Thread extends Model
|
||||||
{
|
{
|
||||||
protected $table = 'ticket_thread';
|
protected $table = 'ticket_thread';
|
||||||
|
@@ -3,6 +3,7 @@
|
|||||||
namespace App\Model\helpdesk\Ticket;
|
namespace App\Model\helpdesk\Ticket;
|
||||||
|
|
||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
|
||||||
class Tickets extends Model
|
class Tickets extends Model
|
||||||
{
|
{
|
||||||
protected $table = 'tickets';
|
protected $table = 'tickets';
|
||||||
|
@@ -36,7 +36,7 @@ class AppServiceProvider extends ServiceProvider
|
|||||||
|
|
||||||
\Cron::add('example2', '*/2 * * * *', function () {
|
\Cron::add('example2', '*/2 * * * *', function () {
|
||||||
// Do some crazy things successfully every two minute
|
// Do some crazy things successfully every two minute
|
||||||
return;
|
|
||||||
});
|
});
|
||||||
|
|
||||||
\Cron::add('disabled job', '0 * * * *', function () {
|
\Cron::add('disabled job', '0 * * * *', function () {
|
||||||
|
@@ -20,9 +20,9 @@ return [
|
|||||||
| Error Log
|
| Error Log
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
|
||||||
| This error log will send email to faveo about the errors. So that before
|
| This error log will send email to faveo about the errors. So that before
|
||||||
| reporting about the errors we at faveo will start solving the issues already.
|
| reporting about the errors we at faveo will start solving the issues already.
|
||||||
| The errors mails will never share your files or data. it will only share
|
| The errors mails will never share your files or data. it will only share
|
||||||
| the line number and error occured.
|
| the line number and error occured.
|
||||||
| To dissable you may just change '%1%' to 0.
|
| To dissable you may just change '%1%' to 0.
|
||||||
*/
|
*/
|
||||||
|
@@ -1,4 +1,5 @@
|
|||||||
<?php /* <body><pre>
|
<?php
|
||||||
|
/* <body><pre>
|
||||||
|
|
||||||
-------------------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------------------
|
||||||
CKEditor - Posted Data
|
CKEditor - Posted Data
|
||||||
|
@@ -1,9 +1,9 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
* Filemanager PHP connector
|
* Filemanager PHP connector
|
||||||
* This file should at least declare auth() function
|
* This file should at least declare auth() function
|
||||||
* and instantiate the Filemanager as '$fm'.
|
* and instantiate the Filemanager as '$fm'.
|
||||||
*
|
*
|
||||||
* IMPORTANT : by default Read and Write access is granted to everyone
|
* IMPORTANT : by default Read and Write access is granted to everyone
|
||||||
* Copy/paste this file to 'user.config.php' file to implement your own auth() function
|
* Copy/paste this file to 'user.config.php' file to implement your own auth() function
|
||||||
* to grant access to wanted users only
|
* to grant access to wanted users only
|
||||||
@@ -60,7 +60,7 @@ if (!$app['auth']->check()) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Check if user is authorized.
|
* Check if user is authorized.
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* @return bool true if access granted, false if no access
|
* @return bool true if access granted, false if no access
|
||||||
*/
|
*/
|
||||||
|
@@ -1213,8 +1213,6 @@ private function is_valid_path($path)
|
|||||||
if ($deleteRootToo) {
|
if ($deleteRootToo) {
|
||||||
@rmdir($dir);
|
@rmdir($dir);
|
||||||
}
|
}
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -1,6 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
|
||||||
*/
|
|
||||||
?>
|
?>
|
||||||
<form style="font-family: Verdana, Tahoma; font-size: 11px">
|
<form style="font-family: Verdana, Tahoma; font-size: 11px">
|
||||||
<input type="hidden" name="demo" value="<?php echo $activeDemo->name; ?>" />
|
<input type="hidden" name="demo" value="<?php echo $activeDemo->name; ?>" />
|
||||||
|
@@ -1,6 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
|
||||||
*/
|
|
||||||
class Demo_addNoise extends Demo
|
class Demo_addNoise extends Demo
|
||||||
{
|
{
|
||||||
public $order = 9350;
|
public $order = 9350;
|
||||||
|
@@ -1,6 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
|
||||||
*/
|
|
||||||
class Demo_applyConvolution extends Demo
|
class Demo_applyConvolution extends Demo
|
||||||
{
|
{
|
||||||
public $order = 2025;
|
public $order = 2025;
|
||||||
|
@@ -1,6 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
|
||||||
*/
|
|
||||||
class Demo_applyFilter extends Demo
|
class Demo_applyFilter extends Demo
|
||||||
{
|
{
|
||||||
public $order = 2000;
|
public $order = 2000;
|
||||||
|
@@ -1,6 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
|
||||||
*/
|
|
||||||
class Demo_applyMask extends Demo
|
class Demo_applyMask extends Demo
|
||||||
{
|
{
|
||||||
public $order = 600;
|
public $order = 600;
|
||||||
|
@@ -1,6 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
|
||||||
*/
|
|
||||||
class Demo_asGrayscale extends Demo
|
class Demo_asGrayscale extends Demo
|
||||||
{
|
{
|
||||||
public $order = 300;
|
public $order = 300;
|
||||||
|
@@ -1,6 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
|
||||||
*/
|
|
||||||
class Demo_asNegative extends Demo
|
class Demo_asNegative extends Demo
|
||||||
{
|
{
|
||||||
public $order = 300;
|
public $order = 300;
|
||||||
|
@@ -1,6 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
|
||||||
*/
|
|
||||||
class Demo_autoCrop extends Demo
|
class Demo_autoCrop extends Demo
|
||||||
{
|
{
|
||||||
public $order = 1050;
|
public $order = 1050;
|
||||||
|
@@ -1,6 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
|
||||||
*/
|
|
||||||
class Demo_correctGamma extends Demo
|
class Demo_correctGamma extends Demo
|
||||||
{
|
{
|
||||||
public $order = 2050;
|
public $order = 2050;
|
||||||
|
@@ -1,6 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
|
||||||
*/
|
|
||||||
class Demo_crop extends Demo
|
class Demo_crop extends Demo
|
||||||
{
|
{
|
||||||
public $order = 1000;
|
public $order = 1000;
|
||||||
|
@@ -1,6 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
|
||||||
*/
|
|
||||||
class Demo_flip extends Demo
|
class Demo_flip extends Demo
|
||||||
{
|
{
|
||||||
public $order = 1200;
|
public $order = 1200;
|
||||||
|
@@ -1,6 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
|
||||||
*/
|
|
||||||
class Demo_getCanvas extends Demo
|
class Demo_getCanvas extends Demo
|
||||||
{
|
{
|
||||||
public $order = 1300;
|
public $order = 1300;
|
||||||
|
@@ -1,6 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
|
||||||
*/
|
|
||||||
class Demo_getChannels extends Demo
|
class Demo_getChannels extends Demo
|
||||||
{
|
{
|
||||||
public $order = 500;
|
public $order = 500;
|
||||||
|
@@ -1,6 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
|
||||||
*/
|
|
||||||
class Demo_getMask extends Demo
|
class Demo_getMask extends Demo
|
||||||
{
|
{
|
||||||
public $order = 550;
|
public $order = 550;
|
||||||
|
@@ -1,6 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
|
||||||
*/
|
|
||||||
class Demo_merge extends Demo
|
class Demo_merge extends Demo
|
||||||
{
|
{
|
||||||
public $order = 800;
|
public $order = 800;
|
||||||
|
@@ -1,6 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
|
||||||
*/
|
|
||||||
class Demo_mirror extends Demo
|
class Demo_mirror extends Demo
|
||||||
{
|
{
|
||||||
public $order = 1150;
|
public $order = 1150;
|
||||||
|
@@ -1,6 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
|
||||||
*/
|
|
||||||
class Demo_resize extends Demo
|
class Demo_resize extends Demo
|
||||||
{
|
{
|
||||||
public $order = 900;
|
public $order = 900;
|
||||||
|
@@ -1,6 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
|
||||||
*/
|
|
||||||
class Demo_resizeCanvas extends Demo
|
class Demo_resizeCanvas extends Demo
|
||||||
{
|
{
|
||||||
public $order = 910;
|
public $order = 910;
|
||||||
|
@@ -1,6 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
|
||||||
*/
|
|
||||||
class Demo_rotate extends Demo
|
class Demo_rotate extends Demo
|
||||||
{
|
{
|
||||||
public $order = 1100;
|
public $order = 1100;
|
||||||
|
@@ -1,6 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
|
||||||
*/
|
|
||||||
class Demo_roundCorners extends Demo
|
class Demo_roundCorners extends Demo
|
||||||
{
|
{
|
||||||
public $order = 1075;
|
public $order = 1075;
|
||||||
|
@@ -1,6 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
|
||||||
*/
|
|
||||||
class Demo_unsharp extends Demo
|
class Demo_unsharp extends Demo
|
||||||
{
|
{
|
||||||
public $order = 1350;
|
public $order = 1350;
|
||||||
|
@@ -1,6 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
|
||||||
*/
|
|
||||||
class AngleField extends IntField
|
class AngleField extends IntField
|
||||||
{
|
{
|
||||||
public function __construct($name, $default, $hint = 'In degrees clockwise, negative values accepted')
|
public function __construct($name, $default, $hint = 'In degrees clockwise, negative values accepted')
|
||||||
|
@@ -1,6 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
|
||||||
*/
|
|
||||||
class CheckboxField extends Field
|
class CheckboxField extends Field
|
||||||
{
|
{
|
||||||
public function init($request)
|
public function init($request)
|
||||||
|
@@ -1,6 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
|
||||||
*/
|
|
||||||
class CheckboxSetField extends Field
|
class CheckboxSetField extends Field
|
||||||
{
|
{
|
||||||
public $options;
|
public $options;
|
||||||
|
@@ -1,6 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
|
||||||
*/
|
|
||||||
class ColorField extends Field
|
class ColorField extends Field
|
||||||
{
|
{
|
||||||
public function __construct($name, $default, $hint = 'RRGGBB hex, leave blank for transparent background')
|
public function __construct($name, $default, $hint = 'RRGGBB hex, leave blank for transparent background')
|
||||||
|
@@ -1,6 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
|
||||||
*/
|
|
||||||
class CoordinateField extends Field
|
class CoordinateField extends Field
|
||||||
{
|
{
|
||||||
public function __construct($name, $default, $hint = 'Smart coordinate')
|
public function __construct($name, $default, $hint = 'Smart coordinate')
|
||||||
|
@@ -1,6 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
|
||||||
*/
|
|
||||||
class Demo
|
class Demo
|
||||||
{
|
{
|
||||||
public $name;
|
public $name;
|
||||||
|
@@ -1,6 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
|
||||||
*/
|
|
||||||
class Field
|
class Field
|
||||||
{
|
{
|
||||||
public $name;
|
public $name;
|
||||||
|
@@ -1,6 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
|
||||||
*/
|
|
||||||
class FileSelectField extends Field
|
class FileSelectField extends Field
|
||||||
{
|
{
|
||||||
public $request;
|
public $request;
|
||||||
|
@@ -1,6 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
|
||||||
*/
|
|
||||||
class FloatField extends Field
|
class FloatField extends Field
|
||||||
{
|
{
|
||||||
public function __construct($name, $default, $hint = 'Float')
|
public function __construct($name, $default, $hint = 'Float')
|
||||||
|
@@ -1,6 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
|
||||||
*/
|
|
||||||
class FormatSelectField extends SelectField
|
class FormatSelectField extends SelectField
|
||||||
{
|
{
|
||||||
public function __construct($name)
|
public function __construct($name)
|
||||||
|
@@ -1,6 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
|
||||||
*/
|
|
||||||
class IntField extends Field
|
class IntField extends Field
|
||||||
{
|
{
|
||||||
public function __construct($name, $default, $hint = 'Integer')
|
public function __construct($name, $default, $hint = 'Integer')
|
||||||
|
@@ -2,9 +2,6 @@
|
|||||||
/**
|
/**
|
||||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
**/
|
**/
|
||||||
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
class Request
|
class Request
|
||||||
{
|
{
|
||||||
protected $vars = [];
|
protected $vars = [];
|
||||||
@@ -33,7 +30,7 @@
|
|||||||
{
|
{
|
||||||
if (strlen($keyval) == 0)
|
if (strlen($keyval) == 0)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (strpos($keyval, '=') === false)
|
if (strpos($keyval, '=') === false)
|
||||||
{
|
{
|
||||||
$key = $keyval;
|
$key = $keyval;
|
||||||
|
@@ -1,6 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
|
||||||
*/
|
|
||||||
class SelectField extends Field
|
class SelectField extends Field
|
||||||
{
|
{
|
||||||
public $options;
|
public $options;
|
||||||
|
@@ -1,6 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
|
||||||
*/
|
|
||||||
define('DEMO_PATH', realpath(dirname(__FILE__).DIRECTORY_SEPARATOR.'..').DIRECTORY_SEPARATOR);
|
define('DEMO_PATH', realpath(dirname(__FILE__).DIRECTORY_SEPARATOR.'..').DIRECTORY_SEPARATOR);
|
||||||
|
|
||||||
error_reporting(E_ALL | E_STRICT);
|
error_reporting(E_ALL | E_STRICT);
|
||||||
|
@@ -1,6 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
|
||||||
*/
|
|
||||||
require_once dirname(__FILE__).'/helpers/common.php';
|
require_once dirname(__FILE__).'/helpers/common.php';
|
||||||
require_once dirname(__FILE__).'/../lib/WideImage.php';
|
require_once dirname(__FILE__).'/../lib/WideImage.php';
|
||||||
|
|
||||||
|
@@ -1,7 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
|
||||||
|
|
||||||
**/
|
|
||||||
include 'helpers/common.php';
|
include 'helpers/common.php';
|
||||||
require_once '../lib/WideImage.php';
|
require_once '../lib/WideImage.php';
|
||||||
|
|
||||||
|
@@ -3,27 +3,18 @@
|
|||||||
* @author Gasper Kozak
|
* @author Gasper Kozak
|
||||||
* @copyright 2007-2011
|
* @copyright 2007-2011
|
||||||
**/
|
**/
|
||||||
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
class WideImage_NoFontException extends WideImage_Exception
|
class WideImage_NoFontException extends WideImage_Exception
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
class WideImage_InvalidFontFileException extends WideImage_Exception
|
class WideImage_InvalidFontFileException extends WideImage_Exception
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
class WideImage_InvalidCanvasMethodException extends WideImage_Exception
|
class WideImage_InvalidCanvasMethodException extends WideImage_Exception
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
class WideImage_Canvas
|
class WideImage_Canvas
|
||||||
{
|
{
|
||||||
protected $handle = 0;
|
protected $handle = 0;
|
||||||
@@ -44,7 +35,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the active font. Can be an instance of
|
* Sets the active font. Can be an instance of
|
||||||
* WideImage_Font_TTF, WideImage_Font_PS, or WideImage_Font_GDF.
|
* WideImage_Font_TTF, WideImage_Font_PS, or WideImage_Font_GDF.
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
@@ -59,12 +50,12 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates and sets the current font.
|
* Creates and sets the current font.
|
||||||
*
|
*
|
||||||
* The supported font types are: TTF/OTF, PS, and GDF.
|
* The supported font types are: TTF/OTF, PS, and GDF.
|
||||||
* Font type is detected from the extension. If the $file parameter doesn't have an extension, TTF font is presumed.
|
* Font type is detected from the extension. If the $file parameter doesn't have an extension, TTF font is presumed.
|
||||||
*
|
*
|
||||||
* Note: not all parameters are supported by all fonts.
|
* Note: not all parameters are supported by all fonts.
|
||||||
*
|
*
|
||||||
* @param string $file Font file name (string)
|
* @param string $file Font file name (string)
|
||||||
* @param int $size Font size (supported for TTF/OTF and PS fonts, ignored for GDF)
|
* @param int $size Font size (supported for TTF/OTF and PS fonts, ignored for GDF)
|
||||||
* @param int $color Text color
|
* @param int $color Text color
|
||||||
@@ -98,11 +89,11 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Write text on the image at specified position.
|
* Write text on the image at specified position.
|
||||||
*
|
*
|
||||||
* You must set a font with a call to WideImage_Canvas::setFont() prior to writing text to the image.
|
* You must set a font with a call to WideImage_Canvas::setFont() prior to writing text to the image.
|
||||||
*
|
*
|
||||||
* Smart coordinates are supported for $x and $y arguments, but currently only for TTF/OTF fonts.
|
* Smart coordinates are supported for $x and $y arguments, but currently only for TTF/OTF fonts.
|
||||||
*
|
*
|
||||||
* Example:
|
* Example:
|
||||||
* <code>
|
* <code>
|
||||||
* $img = WideImage::load('pic.jpg');
|
* $img = WideImage::load('pic.jpg');
|
||||||
@@ -110,7 +101,7 @@
|
|||||||
* $canvas->useFont('Verdana.ttf', 16, $img->allocateColor(255, 0, 0));
|
* $canvas->useFont('Verdana.ttf', 16, $img->allocateColor(255, 0, 0));
|
||||||
* $canvas->writeText('right', 'bottom', 'www.website.com');
|
* $canvas->writeText('right', 'bottom', 'www.website.com');
|
||||||
* </code>
|
* </code>
|
||||||
*
|
*
|
||||||
* @param int $x Left
|
* @param int $x Left
|
||||||
* @param int $y Top
|
* @param int $y Top
|
||||||
* @param string $text Text to write
|
* @param string $text Text to write
|
||||||
@@ -133,9 +124,9 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* A magic method that allows you to call any PHP function that starts with "image".
|
* A magic method that allows you to call any PHP function that starts with "image".
|
||||||
*
|
*
|
||||||
* This is a shortcut to call custom functions on the image handle.
|
* This is a shortcut to call custom functions on the image handle.
|
||||||
*
|
*
|
||||||
* Example:
|
* Example:
|
||||||
* <code>
|
* <code>
|
||||||
* $img = WideImage::load('pic.jpg');
|
* $img = WideImage::load('pic.jpg');
|
||||||
|
@@ -3,9 +3,6 @@
|
|||||||
* @author Gasper Kozak
|
* @author Gasper Kozak
|
||||||
* @copyright 2007-2011
|
* @copyright 2007-2011
|
||||||
**/
|
**/
|
||||||
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
class WideImage_InvalidCoordinateException extends WideImage_Exception
|
class WideImage_InvalidCoordinateException extends WideImage_Exception
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@@ -20,7 +17,7 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Parses a numeric or string representation of a corrdinate into a structure.
|
* Parses a numeric or string representation of a corrdinate into a structure.
|
||||||
*
|
*
|
||||||
* @param string $coord Smart coordinate
|
* @param string $coord Smart coordinate
|
||||||
*
|
*
|
||||||
* @return array Parsed smart coordinate
|
* @return array Parsed smart coordinate
|
||||||
@@ -71,7 +68,7 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Evaluates the $coord relatively to $dim.
|
* Evaluates the $coord relatively to $dim.
|
||||||
*
|
*
|
||||||
* @param string $coord A numeric value or percent string
|
* @param string $coord A numeric value or percent string
|
||||||
* @param int $dim Dimension
|
* @param int $dim Dimension
|
||||||
* @param int $sec_dim Secondary dimension (for align)
|
* @param int $sec_dim Secondary dimension (for align)
|
||||||
@@ -130,7 +127,7 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Calculates and fixes a smart coordinate into a numeric value.
|
* Calculates and fixes a smart coordinate into a numeric value.
|
||||||
*
|
*
|
||||||
* @param mixed $value Smart coordinate, relative to $dim
|
* @param mixed $value Smart coordinate, relative to $dim
|
||||||
* @param int $dim Coordinate to which $value is relative
|
* @param int $dim Coordinate to which $value is relative
|
||||||
* @param int $sec_dim Secondary dimension (for align)
|
* @param int $sec_dim Secondary dimension (for align)
|
||||||
|
@@ -22,7 +22,7 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Writes text onto an image.
|
* Writes text onto an image.
|
||||||
*
|
*
|
||||||
* @param WideImage_Image $image
|
* @param WideImage_Image $image
|
||||||
* @param mixed $x smart coordinate
|
* @param mixed $x smart coordinate
|
||||||
* @param mixed $y smart coordinate
|
* @param mixed $y smart coordinate
|
||||||
|
@@ -62,7 +62,7 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Cleanup.
|
* Cleanup.
|
||||||
*
|
*
|
||||||
* Destroys the handle via WideImage_Image::destroy() when called by the GC.
|
* Destroys the handle via WideImage_Image::destroy() when called by the GC.
|
||||||
*/
|
*/
|
||||||
public function __destruct()
|
public function __destruct()
|
||||||
@@ -72,7 +72,7 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* This method destroy the image handle, and releases the image resource.
|
* This method destroy the image handle, and releases the image resource.
|
||||||
*
|
*
|
||||||
* After this is called, the object doesn't hold a valid image any more.
|
* After this is called, the object doesn't hold a valid image any more.
|
||||||
* No operation should be called after that.
|
* No operation should be called after that.
|
||||||
*/
|
*/
|
||||||
@@ -87,7 +87,7 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the GD image resource.
|
* Returns the GD image resource.
|
||||||
*
|
*
|
||||||
* @return resource GD image resource
|
* @return resource GD image resource
|
||||||
*/
|
*/
|
||||||
public function getHandle()
|
public function getHandle()
|
||||||
@@ -113,29 +113,29 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Saves an image to a file.
|
* Saves an image to a file.
|
||||||
*
|
*
|
||||||
* The file type is recognized from the $uri. If you save to a GIF8, truecolor images
|
* The file type is recognized from the $uri. If you save to a GIF8, truecolor images
|
||||||
* are automatically converted to palette.
|
* are automatically converted to palette.
|
||||||
*
|
*
|
||||||
* This method supports additional parameters: quality (for jpeg images) and
|
* This method supports additional parameters: quality (for jpeg images) and
|
||||||
* compression quality and filters (for png images). See http://www.php.net/imagejpeg and
|
* compression quality and filters (for png images). See http://www.php.net/imagejpeg and
|
||||||
* http://www.php.net/imagepng for details.
|
* http://www.php.net/imagepng for details.
|
||||||
*
|
*
|
||||||
* Examples:
|
* Examples:
|
||||||
* <code>
|
* <code>
|
||||||
* // save to a GIF
|
* // save to a GIF
|
||||||
* $image->saveToFile('image.gif');
|
* $image->saveToFile('image.gif');
|
||||||
*
|
*
|
||||||
* // save to a PNG with compression=7 and no filters
|
* // save to a PNG with compression=7 and no filters
|
||||||
* $image->saveToFile('image.png', 7, PNG_NO_FILTER);
|
* $image->saveToFile('image.png', 7, PNG_NO_FILTER);
|
||||||
*
|
*
|
||||||
* // save to a JPEG with quality=80
|
* // save to a JPEG with quality=80
|
||||||
* $image->saveToFile('image.jpg', 80);
|
* $image->saveToFile('image.jpg', 80);
|
||||||
*
|
*
|
||||||
* // save to a JPEG with default quality=100
|
* // save to a JPEG with default quality=100
|
||||||
* $image->saveToFile('image.jpg');
|
* $image->saveToFile('image.jpg');
|
||||||
* </code>
|
* </code>
|
||||||
*
|
*
|
||||||
* @param string $uri File location
|
* @param string $uri File location
|
||||||
*/
|
*/
|
||||||
public function saveToFile($uri)
|
public function saveToFile($uri)
|
||||||
@@ -151,9 +151,9 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns binary string with image data in format specified by $format.
|
* Returns binary string with image data in format specified by $format.
|
||||||
*
|
*
|
||||||
* Additional parameters may be passed to the function. See WideImage_Image::saveToFile() for more details.
|
* Additional parameters may be passed to the function. See WideImage_Image::saveToFile() for more details.
|
||||||
*
|
*
|
||||||
* @param string $format The format of the image
|
* @param string $format The format of the image
|
||||||
*
|
*
|
||||||
* @return string The binary image data in specified format
|
* @return string The binary image data in specified format
|
||||||
@@ -176,7 +176,7 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Output a header to browser.
|
* Output a header to browser.
|
||||||
*
|
*
|
||||||
* @param $name Name of the header
|
* @param $name Name of the header
|
||||||
* @param $data Data
|
* @param $data Data
|
||||||
*/
|
*/
|
||||||
@@ -187,15 +187,15 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Outputs the image to browser.
|
* Outputs the image to browser.
|
||||||
*
|
*
|
||||||
* Sets headers Content-length and Content-type, and echoes the image in the specified format.
|
* Sets headers Content-length and Content-type, and echoes the image in the specified format.
|
||||||
* All other headers (such as Content-disposition) must be added manually.
|
* All other headers (such as Content-disposition) must be added manually.
|
||||||
*
|
*
|
||||||
* Example:
|
* Example:
|
||||||
* <code>
|
* <code>
|
||||||
* WideImage::load('image1.png')->resize(100, 100)->output('gif');
|
* WideImage::load('image1.png')->resize(100, 100)->output('gif');
|
||||||
* </code>
|
* </code>
|
||||||
*
|
*
|
||||||
* @param string $format Image format
|
* @param string $format Image format
|
||||||
*/
|
*/
|
||||||
public function output($format)
|
public function output($format)
|
||||||
@@ -226,7 +226,7 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Allocate a color by RGB values.
|
* Allocate a color by RGB values.
|
||||||
*
|
*
|
||||||
* @param mixed $R Red-component value or an RGB array (with red, green, blue keys)
|
* @param mixed $R Red-component value or an RGB array (with red, green, blue keys)
|
||||||
* @param int $G If $R is int, this is the green component
|
* @param int $G If $R is int, this is the green component
|
||||||
* @param int $B If $R is int, this is the blue component
|
* @param int $B If $R is int, this is the blue component
|
||||||
@@ -260,7 +260,7 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the current transparent color index. Only makes sense for palette images (8-bit).
|
* Sets the current transparent color index. Only makes sense for palette images (8-bit).
|
||||||
*
|
*
|
||||||
* @param int $color Transparent color index
|
* @param int $color Transparent color index
|
||||||
*/
|
*/
|
||||||
public function setTransparentColor($color)
|
public function setTransparentColor($color)
|
||||||
@@ -270,7 +270,7 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a RGB array of the transparent color or null if none.
|
* Returns a RGB array of the transparent color or null if none.
|
||||||
*
|
*
|
||||||
* @return mixed Transparent color RGBA array
|
* @return mixed Transparent color RGBA array
|
||||||
*/
|
*/
|
||||||
public function getTransparentColorRGB()
|
public function getTransparentColorRGB()
|
||||||
@@ -287,11 +287,11 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a RGBA array for pixel at $x, $y.
|
* Returns a RGBA array for pixel at $x, $y.
|
||||||
*
|
*
|
||||||
* @param int $x
|
* @param int $x
|
||||||
* @param int $y
|
* @param int $y
|
||||||
*
|
*
|
||||||
* @return array RGB array
|
* @return array RGB array
|
||||||
*/
|
*/
|
||||||
public function getRGBAt($x, $y)
|
public function getRGBAt($x, $y)
|
||||||
{
|
{
|
||||||
@@ -300,7 +300,7 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Writes a pixel at the designated coordinates.
|
* Writes a pixel at the designated coordinates.
|
||||||
*
|
*
|
||||||
* Takes an associative array of colours and uses getExactColor() to
|
* Takes an associative array of colours and uses getExactColor() to
|
||||||
* retrieve the exact index color to write to the image with.
|
* retrieve the exact index color to write to the image with.
|
||||||
*
|
*
|
||||||
@@ -315,7 +315,7 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a color's RGB.
|
* Returns a color's RGB.
|
||||||
*
|
*
|
||||||
* @param int $colorIndex Color index
|
* @param int $colorIndex Color index
|
||||||
*
|
*
|
||||||
* @return mixed RGBA array for a color with index $colorIndex
|
* @return mixed RGBA array for a color with index $colorIndex
|
||||||
@@ -327,7 +327,7 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns an index of the color at $x, $y.
|
* Returns an index of the color at $x, $y.
|
||||||
*
|
*
|
||||||
* @param int $x
|
* @param int $x
|
||||||
* @param int $y
|
* @param int $y
|
||||||
*
|
*
|
||||||
@@ -340,7 +340,7 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the color index $color to a pixel at $x, $y.
|
* Set the color index $color to a pixel at $x, $y.
|
||||||
*
|
*
|
||||||
* @param int $x
|
* @param int $x
|
||||||
* @param int $y
|
* @param int $y
|
||||||
* @param int $color Color index
|
* @param int $color Color index
|
||||||
@@ -353,7 +353,7 @@
|
|||||||
/**
|
/**
|
||||||
* Returns closest color index that matches the given RGB value. Uses
|
* Returns closest color index that matches the given RGB value. Uses
|
||||||
* PHP's imagecolorclosest().
|
* PHP's imagecolorclosest().
|
||||||
*
|
*
|
||||||
* @param mixed $R Red or RGBA array
|
* @param mixed $R Red or RGBA array
|
||||||
* @param int $G Green component (or null if $R is an RGB array)
|
* @param int $G Green component (or null if $R is an RGB array)
|
||||||
* @param int $B Blue component (or null if $R is an RGB array)
|
* @param int $B Blue component (or null if $R is an RGB array)
|
||||||
@@ -372,7 +372,7 @@
|
|||||||
/**
|
/**
|
||||||
* Returns the color index that exactly matches the given RGB value. Uses
|
* Returns the color index that exactly matches the given RGB value. Uses
|
||||||
* PHP's imagecolorexact().
|
* PHP's imagecolorexact().
|
||||||
*
|
*
|
||||||
* @param mixed $R Red or RGBA array
|
* @param mixed $R Red or RGBA array
|
||||||
* @param int $G Green component (or null if $R is an RGB array)
|
* @param int $G Green component (or null if $R is an RGB array)
|
||||||
* @param int $B Blue component (or null if $R is an RGB array)
|
* @param int $B Blue component (or null if $R is an RGB array)
|
||||||
@@ -391,7 +391,7 @@
|
|||||||
/**
|
/**
|
||||||
* Copies transparency information from $sourceImage. Optionally fills
|
* Copies transparency information from $sourceImage. Optionally fills
|
||||||
* the image with the transparent color at (0, 0).
|
* the image with the transparent color at (0, 0).
|
||||||
*
|
*
|
||||||
* @param object $sourceImage
|
* @param object $sourceImage
|
||||||
* @param bool $fill True if you want to fill the image with transparent color
|
* @param bool $fill True if you want to fill the image with transparent color
|
||||||
*/
|
*/
|
||||||
@@ -419,7 +419,7 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Fill the image at ($x, $y) with color index $color.
|
* Fill the image at ($x, $y) with color index $color.
|
||||||
*
|
*
|
||||||
* @param int $x
|
* @param int $x
|
||||||
* @param int $y
|
* @param int $y
|
||||||
* @param int $color
|
* @param int $color
|
||||||
@@ -443,13 +443,13 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the image's mask.
|
* Returns the image's mask.
|
||||||
*
|
*
|
||||||
* Mask is a greyscale image where the shade defines the alpha channel (black = transparent, white = opaque).
|
* Mask is a greyscale image where the shade defines the alpha channel (black = transparent, white = opaque).
|
||||||
*
|
*
|
||||||
* For opaque images (JPEG), the result will be white. For images with single-color transparency (GIF, 8-bit PNG),
|
* For opaque images (JPEG), the result will be white. For images with single-color transparency (GIF, 8-bit PNG),
|
||||||
* the areas with the transparent color will be black. For images with alpha channel transparenct,
|
* the areas with the transparent color will be black. For images with alpha channel transparenct,
|
||||||
* the result will be alpha channel.
|
* the result will be alpha channel.
|
||||||
*
|
*
|
||||||
* @return WideImage_Image An image mask
|
* @return WideImage_Image An image mask
|
||||||
**/
|
**/
|
||||||
public function getMask()
|
public function getMask()
|
||||||
@@ -459,23 +459,23 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Resize the image to given dimensions.
|
* Resize the image to given dimensions.
|
||||||
*
|
*
|
||||||
* $width and $height are both smart coordinates. This means that you can pass any of these values in:
|
* $width and $height are both smart coordinates. This means that you can pass any of these values in:
|
||||||
* - positive or negative integer (100, -20, ...)
|
* - positive or negative integer (100, -20, ...)
|
||||||
* - positive or negative percent string (30%, -15%, ...)
|
* - positive or negative percent string (30%, -15%, ...)
|
||||||
* - complex coordinate (50% - 20, 15 + 30%, ...)
|
* - complex coordinate (50% - 20, 15 + 30%, ...)
|
||||||
*
|
*
|
||||||
* If $width is null, it's calculated proportionally from $height, and vice versa.
|
* If $width is null, it's calculated proportionally from $height, and vice versa.
|
||||||
*
|
*
|
||||||
* Example (resize to half-size):
|
* Example (resize to half-size):
|
||||||
* <code>
|
* <code>
|
||||||
* $smaller = $image->resize('50%');
|
* $smaller = $image->resize('50%');
|
||||||
*
|
*
|
||||||
* $smaller = $image->resize('100', '100', 'inside', 'down');
|
* $smaller = $image->resize('100', '100', 'inside', 'down');
|
||||||
* is the same as
|
* is the same as
|
||||||
* $smaller = $image->resizeDown(100, 100, 'inside');
|
* $smaller = $image->resizeDown(100, 100, 'inside');
|
||||||
* </code>
|
* </code>
|
||||||
*
|
*
|
||||||
* @param mixed $width The new width (smart coordinate), or null.
|
* @param mixed $width The new width (smart coordinate), or null.
|
||||||
* @param mixed $height The new height (smart coordinate), or null.
|
* @param mixed $height The new height (smart coordinate), or null.
|
||||||
* @param string $fit 'inside', 'outside', 'fill'
|
* @param string $fit 'inside', 'outside', 'fill'
|
||||||
@@ -491,7 +491,7 @@
|
|||||||
/**
|
/**
|
||||||
* Same as WideImage_Image::resize(), but the image is only applied if it is larger then the given dimensions.
|
* Same as WideImage_Image::resize(), but the image is only applied if it is larger then the given dimensions.
|
||||||
* Otherwise, the resulting image retains the source's dimensions.
|
* Otherwise, the resulting image retains the source's dimensions.
|
||||||
*
|
*
|
||||||
* @param int $width New width, smart coordinate
|
* @param int $width New width, smart coordinate
|
||||||
* @param int $height New height, smart coordinate
|
* @param int $height New height, smart coordinate
|
||||||
* @param string $fit 'inside', 'outside', 'fill'
|
* @param string $fit 'inside', 'outside', 'fill'
|
||||||
@@ -506,7 +506,7 @@
|
|||||||
/**
|
/**
|
||||||
* Same as WideImage_Image::resize(), but the image is only applied if it is smaller then the given dimensions.
|
* Same as WideImage_Image::resize(), but the image is only applied if it is smaller then the given dimensions.
|
||||||
* Otherwise, the resulting image retains the source's dimensions.
|
* Otherwise, the resulting image retains the source's dimensions.
|
||||||
*
|
*
|
||||||
* @param int $width New width, smart coordinate
|
* @param int $width New width, smart coordinate
|
||||||
* @param int $height New height, smart coordinate
|
* @param int $height New height, smart coordinate
|
||||||
* @param string $fit 'inside', 'outside', 'fill'
|
* @param string $fit 'inside', 'outside', 'fill'
|
||||||
@@ -520,9 +520,9 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Rotate the image for angle $angle clockwise.
|
* Rotate the image for angle $angle clockwise.
|
||||||
*
|
*
|
||||||
* Preserves transparency. Has issues when saving to a BMP.
|
* Preserves transparency. Has issues when saving to a BMP.
|
||||||
*
|
*
|
||||||
* @param int $angle Angle in degrees, clock-wise
|
* @param int $angle Angle in degrees, clock-wise
|
||||||
* @param int $bgColor color of the new background
|
* @param int $bgColor color of the new background
|
||||||
* @param bool $ignoreTransparent
|
* @param bool $ignoreTransparent
|
||||||
@@ -536,9 +536,9 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* This method lays the overlay (watermark) on the image.
|
* This method lays the overlay (watermark) on the image.
|
||||||
*
|
*
|
||||||
* Hint: if the overlay is a truecolor image with alpha channel, you should leave $pct at 100.
|
* Hint: if the overlay is a truecolor image with alpha channel, you should leave $pct at 100.
|
||||||
*
|
*
|
||||||
* This operation supports alignment notation in coordinates:
|
* This operation supports alignment notation in coordinates:
|
||||||
* <code>
|
* <code>
|
||||||
* $watermark = WideImage::load('logo.gif');
|
* $watermark = WideImage::load('logo.gif');
|
||||||
@@ -546,7 +546,7 @@
|
|||||||
* $result = $base->merge($watermark, "right - 10", "bottom - 10", 50);
|
* $result = $base->merge($watermark, "right - 10", "bottom - 10", 50);
|
||||||
* // applies a logo aligned to bottom-right corner with a 10 pixel margin
|
* // applies a logo aligned to bottom-right corner with a 10 pixel margin
|
||||||
* </code>
|
* </code>
|
||||||
*
|
*
|
||||||
* @param WideImage_Image $overlay The overlay image
|
* @param WideImage_Image $overlay The overlay image
|
||||||
* @param mixed $left Left position of the overlay, smart coordinate
|
* @param mixed $left Left position of the overlay, smart coordinate
|
||||||
* @param mixed $top Top position of the overlay, smart coordinate
|
* @param mixed $top Top position of the overlay, smart coordinate
|
||||||
@@ -561,31 +561,31 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Resizes the canvas of the image, but doesn't scale the content of the image.
|
* Resizes the canvas of the image, but doesn't scale the content of the image.
|
||||||
*
|
*
|
||||||
* This operation creates an empty canvas with dimensions $width x $height, filled with
|
* This operation creates an empty canvas with dimensions $width x $height, filled with
|
||||||
* background color $bg_color and draws the original image onto it at position [$pos_x, $pos_y].
|
* background color $bg_color and draws the original image onto it at position [$pos_x, $pos_y].
|
||||||
*
|
*
|
||||||
* Arguments $width, $height, $pos_x and $pos_y are all smart coordinates. $width and $height are
|
* Arguments $width, $height, $pos_x and $pos_y are all smart coordinates. $width and $height are
|
||||||
* relative to the current image size, $pos_x and $pos_y are relative to the newly calculated
|
* relative to the current image size, $pos_x and $pos_y are relative to the newly calculated
|
||||||
* canvas size. This can be confusing, but it makes sense. See the example below.
|
* canvas size. This can be confusing, but it makes sense. See the example below.
|
||||||
*
|
*
|
||||||
* The example below loads a 100x150 image and then resizes its canvas to 200% x 100%+20
|
* The example below loads a 100x150 image and then resizes its canvas to 200% x 100%+20
|
||||||
* (which evaluates to 200x170). The image is placed at position [10, center+20], which evaluates to [10, 30].
|
* (which evaluates to 200x170). The image is placed at position [10, center+20], which evaluates to [10, 30].
|
||||||
* <code>
|
* <code>
|
||||||
* $image = WideImage::load('someimage.jpg'); // 100x150
|
* $image = WideImage::load('someimage.jpg'); // 100x150
|
||||||
* $white = $image->allocateColor(255, 255, 255);
|
* $white = $image->allocateColor(255, 255, 255);
|
||||||
* $image->resizeCanvas('200%', '100% + 20', 10, 'center+20', $white);
|
* $image->resizeCanvas('200%', '100% + 20', 10, 'center+20', $white);
|
||||||
* </code>
|
* </code>
|
||||||
*
|
*
|
||||||
* The parameter $merge defines whether the original image should be merged onto the new canvas.
|
* The parameter $merge defines whether the original image should be merged onto the new canvas.
|
||||||
* This means it blends transparent color and alpha colors into the background color. If set to false,
|
* This means it blends transparent color and alpha colors into the background color. If set to false,
|
||||||
* the original image is just copied over, preserving the transparency/alpha information.
|
* the original image is just copied over, preserving the transparency/alpha information.
|
||||||
*
|
*
|
||||||
* You can set the $scale parameter to limit when to resize the canvas. For example, if you want
|
* You can set the $scale parameter to limit when to resize the canvas. For example, if you want
|
||||||
* to resize the canvas only if the image is smaller than the new size, but leave the image intact
|
* to resize the canvas only if the image is smaller than the new size, but leave the image intact
|
||||||
* if it's larger, set it to 'up'. Likewise, if you want to shrink the canvas, but don't want to
|
* if it's larger, set it to 'up'. Likewise, if you want to shrink the canvas, but don't want to
|
||||||
* change images that are already smaller, set it to 'down'.
|
* change images that are already smaller, set it to 'down'.
|
||||||
*
|
*
|
||||||
* @param mixed $width Width of the new canvas (smart coordinate, relative to current image width)
|
* @param mixed $width Width of the new canvas (smart coordinate, relative to current image width)
|
||||||
* @param mixed $height Height of the new canvas (smart coordinate, relative to current image height)
|
* @param mixed $height Height of the new canvas (smart coordinate, relative to current image height)
|
||||||
* @param mixed $pos_x x-position of the image (smart coordinate, relative to the new width)
|
* @param mixed $pos_x x-position of the image (smart coordinate, relative to the new width)
|
||||||
@@ -603,31 +603,31 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns an image with round corners.
|
* Returns an image with round corners.
|
||||||
*
|
*
|
||||||
* You can either set the corners' color or set them transparent.
|
* You can either set the corners' color or set them transparent.
|
||||||
*
|
*
|
||||||
* Note on $smoothness: 1 means jagged edges, 2 is much better, more than 4 doesn't noticeably improve the quality.
|
* Note on $smoothness: 1 means jagged edges, 2 is much better, more than 4 doesn't noticeably improve the quality.
|
||||||
* Rendering becomes increasingly slower if you increase smoothness.
|
* Rendering becomes increasingly slower if you increase smoothness.
|
||||||
*
|
*
|
||||||
* Example:
|
* Example:
|
||||||
* <code>
|
* <code>
|
||||||
* $nice = $ugly->roundCorners(20, $ugly->allocateColor(255, 0, 0), 2);
|
* $nice = $ugly->roundCorners(20, $ugly->allocateColor(255, 0, 0), 2);
|
||||||
* </code>
|
* </code>
|
||||||
*
|
*
|
||||||
* Use $corners parameter to specify which corners to draw rounded. Possible values are
|
* Use $corners parameter to specify which corners to draw rounded. Possible values are
|
||||||
* WideImage::SIDE_TOP_LEFT, WideImage::SIDE_TOP,
|
* WideImage::SIDE_TOP_LEFT, WideImage::SIDE_TOP,
|
||||||
* WideImage::SIDE_TOP_RIGHT, WideImage::SIDE_RIGHT,
|
* WideImage::SIDE_TOP_RIGHT, WideImage::SIDE_RIGHT,
|
||||||
* WideImage::SIDE_BOTTOM_RIGHT, WideImage::SIDE_BOTTOM,
|
* WideImage::SIDE_BOTTOM_RIGHT, WideImage::SIDE_BOTTOM,
|
||||||
* WideImage::SIDE_BOTTOM_LEFT, WideImage::SIDE_LEFT, and WideImage::SIDE_ALL.
|
* WideImage::SIDE_BOTTOM_LEFT, WideImage::SIDE_LEFT, and WideImage::SIDE_ALL.
|
||||||
* You can specify any combination of corners with a + operation, see example below.
|
* You can specify any combination of corners with a + operation, see example below.
|
||||||
*
|
*
|
||||||
* Example:
|
* Example:
|
||||||
* <code>
|
* <code>
|
||||||
* $white = $image->allocateColor(255, 255, 255);
|
* $white = $image->allocateColor(255, 255, 255);
|
||||||
* $diagonal_corners = $image->roundCorners(15, $white, 2, WideImage::SIDE_TOP_LEFT + WideImage::SIDE_BOTTOM_RIGHT);
|
* $diagonal_corners = $image->roundCorners(15, $white, 2, WideImage::SIDE_TOP_LEFT + WideImage::SIDE_BOTTOM_RIGHT);
|
||||||
* $right_corners = $image->roundCorners(15, $white, 2, WideImage::SIDE_RIGHT);
|
* $right_corners = $image->roundCorners(15, $white, 2, WideImage::SIDE_RIGHT);
|
||||||
* </code>
|
* </code>
|
||||||
*
|
*
|
||||||
* @param int $radius Radius of the corners
|
* @param int $radius Radius of the corners
|
||||||
* @param int $color The color of corners. If null, corners are rendered transparent (slower than using a solid color).
|
* @param int $color The color of corners. If null, corners are rendered transparent (slower than using a solid color).
|
||||||
* @param int $smoothness Specify the level of smoothness. Suggested values from 1 to 4.
|
* @param int $smoothness Specify the level of smoothness. Suggested values from 1 to 4.
|
||||||
@@ -642,10 +642,10 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns an image with applied mask.
|
* Returns an image with applied mask.
|
||||||
*
|
*
|
||||||
* A mask is a grayscale image, where the shade determines the alpha channel. Black is fully transparent
|
* A mask is a grayscale image, where the shade determines the alpha channel. Black is fully transparent
|
||||||
* and white is fully opaque.
|
* and white is fully opaque.
|
||||||
*
|
*
|
||||||
* @param WideImage_Image $mask The mask image, greyscale
|
* @param WideImage_Image $mask The mask image, greyscale
|
||||||
* @param mixed $left Left coordinate, smart coordinate
|
* @param mixed $left Left coordinate, smart coordinate
|
||||||
* @param mixed $top Top coordinate, smart coordinate
|
* @param mixed $top Top coordinate, smart coordinate
|
||||||
@@ -689,23 +689,23 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a cropped rectangular portion of the image.
|
* Returns a cropped rectangular portion of the image.
|
||||||
*
|
*
|
||||||
* If the rectangle specifies area that is out of bounds, it's limited to the current image bounds.
|
* If the rectangle specifies area that is out of bounds, it's limited to the current image bounds.
|
||||||
*
|
*
|
||||||
* Examples:
|
* Examples:
|
||||||
* <code>
|
* <code>
|
||||||
* $cropped = $img->crop(10, 10, 150, 200); // crops a 150x200 rect at (10, 10)
|
* $cropped = $img->crop(10, 10, 150, 200); // crops a 150x200 rect at (10, 10)
|
||||||
* $cropped = $img->crop(-100, -50, 100, 50); // crops a 100x50 rect at the right-bottom of the image
|
* $cropped = $img->crop(-100, -50, 100, 50); // crops a 100x50 rect at the right-bottom of the image
|
||||||
* $cropped = $img->crop('25%', '25%', '50%', '50%'); // crops a 50%x50% rect from the center of the image
|
* $cropped = $img->crop('25%', '25%', '50%', '50%'); // crops a 50%x50% rect from the center of the image
|
||||||
* </code>
|
* </code>
|
||||||
*
|
*
|
||||||
* This operation supports alignment notation in left/top coordinates.
|
* This operation supports alignment notation in left/top coordinates.
|
||||||
* Example:
|
* Example:
|
||||||
* <code>
|
* <code>
|
||||||
* $cropped = $img->crop("right", "bottom", 100, 200); // crops a 100x200 rect from right bottom
|
* $cropped = $img->crop("right", "bottom", 100, 200); // crops a 100x200 rect from right bottom
|
||||||
* $cropped = $img->crop("center", "middle", 50, 30); // crops a 50x30 from the center of the image
|
* $cropped = $img->crop("center", "middle", 50, 30); // crops a 50x30 from the center of the image
|
||||||
* </code>
|
* </code>
|
||||||
*
|
*
|
||||||
* @param mixed $left Left-coordinate of the crop rect, smart coordinate
|
* @param mixed $left Left-coordinate of the crop rect, smart coordinate
|
||||||
* @param mixed $top Top-coordinate of the crop rect, smart coordinate
|
* @param mixed $top Top-coordinate of the crop rect, smart coordinate
|
||||||
* @param mixed $width Width of the crop rect, smart coordinate
|
* @param mixed $width Width of the crop rect, smart coordinate
|
||||||
@@ -721,13 +721,13 @@
|
|||||||
/**
|
/**
|
||||||
* Performs an auto-crop on the image.
|
* Performs an auto-crop on the image.
|
||||||
*
|
*
|
||||||
* The image is auto-cropped from each of four sides. All sides are
|
* The image is auto-cropped from each of four sides. All sides are
|
||||||
* scanned for pixels that differ from $base_color for more than
|
* scanned for pixels that differ from $base_color for more than
|
||||||
* $rgb_threshold in absolute RGB difference. If more than $pixel_cutoff
|
* $rgb_threshold in absolute RGB difference. If more than $pixel_cutoff
|
||||||
* differentiating pixels are found, that line is considered to be the crop line for the side.
|
* differentiating pixels are found, that line is considered to be the crop line for the side.
|
||||||
* If the line isn't different enough, the algorithm procedes to the next line
|
* If the line isn't different enough, the algorithm procedes to the next line
|
||||||
* towards the other edge of the image.
|
* towards the other edge of the image.
|
||||||
*
|
*
|
||||||
* When the crop rectangle is found, it's enlarged by the $margin value on each of the four sides.
|
* When the crop rectangle is found, it's enlarged by the $margin value on each of the four sides.
|
||||||
*
|
*
|
||||||
* @param int $margin Margin for the crop rectangle, can be negative.
|
* @param int $margin Margin for the crop rectangle, can be negative.
|
||||||
@@ -758,7 +758,7 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a grayscale copy of the image.
|
* Returns a grayscale copy of the image.
|
||||||
*
|
*
|
||||||
* @return WideImage_Image grayscale copy
|
* @return WideImage_Image grayscale copy
|
||||||
**/
|
**/
|
||||||
public function asGrayscale()
|
public function asGrayscale()
|
||||||
@@ -768,7 +768,7 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a mirrored copy of the image.
|
* Returns a mirrored copy of the image.
|
||||||
*
|
*
|
||||||
* @return WideImage_Image Mirrored copy
|
* @return WideImage_Image Mirrored copy
|
||||||
**/
|
**/
|
||||||
public function mirror()
|
public function mirror()
|
||||||
@@ -778,7 +778,7 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Applies the unsharp filter.
|
* Applies the unsharp filter.
|
||||||
*
|
*
|
||||||
* @param float $amount
|
* @param float $amount
|
||||||
* @param float $radius
|
* @param float $radius
|
||||||
* @param float $threshold
|
* @param float $threshold
|
||||||
@@ -792,7 +792,7 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a flipped (mirrored over horizontal line) copy of the image.
|
* Returns a flipped (mirrored over horizontal line) copy of the image.
|
||||||
*
|
*
|
||||||
* @return WideImage_Image Flipped copy
|
* @return WideImage_Image Flipped copy
|
||||||
**/
|
**/
|
||||||
public function flip()
|
public function flip()
|
||||||
@@ -802,7 +802,7 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Corrects gamma on the image.
|
* Corrects gamma on the image.
|
||||||
*
|
*
|
||||||
* @param float $inputGamma
|
* @param float $inputGamma
|
||||||
* @param float $outputGamma
|
* @param float $outputGamma
|
||||||
*
|
*
|
||||||
@@ -815,9 +815,9 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Adds noise to the image.
|
* Adds noise to the image.
|
||||||
*
|
*
|
||||||
* @author Tomasz Kapusta
|
* @author Tomasz Kapusta
|
||||||
*
|
*
|
||||||
* @param int $amount Number of noise pixels to add
|
* @param int $amount Number of noise pixels to add
|
||||||
* @param string $type Type of noise 'salt&pepper', 'color' or 'mono'
|
* @param string $type Type of noise 'salt&pepper', 'color' or 'mono'
|
||||||
*
|
*
|
||||||
@@ -860,7 +860,7 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a copy of the image object.
|
* Returns a copy of the image object.
|
||||||
*
|
*
|
||||||
* @return WideImage_Image The copy
|
* @return WideImage_Image The copy
|
||||||
**/
|
**/
|
||||||
public function copy()
|
public function copy()
|
||||||
@@ -874,7 +874,7 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Copies this image onto another image.
|
* Copies this image onto another image.
|
||||||
*
|
*
|
||||||
* @param WideImage_Image $dest
|
* @param WideImage_Image $dest
|
||||||
* @param int $left
|
* @param int $left
|
||||||
* @param int $top
|
* @param int $top
|
||||||
@@ -888,21 +888,21 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the canvas object.
|
* Returns the canvas object.
|
||||||
*
|
*
|
||||||
* The Canvas object can be used to draw text and shapes on the image
|
* The Canvas object can be used to draw text and shapes on the image
|
||||||
*
|
*
|
||||||
* Examples:
|
* Examples:
|
||||||
* <code>
|
* <code>
|
||||||
* $img = WideImage::load('pic.jpg);
|
* $img = WideImage::load('pic.jpg);
|
||||||
* $canvas = $img->getCanvas();
|
* $canvas = $img->getCanvas();
|
||||||
* $canvas->useFont('arial.ttf', 15, $img->allocateColor(200, 220, 255));
|
* $canvas->useFont('arial.ttf', 15, $img->allocateColor(200, 220, 255));
|
||||||
* $canvas->writeText(10, 50, "Hello world!");
|
* $canvas->writeText(10, 50, "Hello world!");
|
||||||
*
|
*
|
||||||
* $canvas->filledRectangle(10, 10, 80, 40, $img->allocateColor(255, 127, 255));
|
* $canvas->filledRectangle(10, 10, 80, 40, $img->allocateColor(255, 127, 255));
|
||||||
* $canvas->line(60, 80, 30, 100, $img->allocateColor(255, 0, 0));
|
* $canvas->line(60, 80, 30, 100, $img->allocateColor(255, 0, 0));
|
||||||
* $img->saveToFile('new.png');
|
* $img->saveToFile('new.png');
|
||||||
* </code>
|
* </code>
|
||||||
*
|
*
|
||||||
* @return WideImage_Canvas The Canvas object
|
* @return WideImage_Canvas The Canvas object
|
||||||
**/
|
**/
|
||||||
public function getCanvas()
|
public function getCanvas()
|
||||||
@@ -916,14 +916,14 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns true if the image is true-color, false otherwise.
|
* Returns true if the image is true-color, false otherwise.
|
||||||
*
|
*
|
||||||
* @return bool
|
* @return bool
|
||||||
**/
|
**/
|
||||||
abstract public function isTrueColor();
|
abstract public function isTrueColor();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a true-color copy of the image.
|
* Returns a true-color copy of the image.
|
||||||
*
|
*
|
||||||
* @return WideImage_TrueColorImage
|
* @return WideImage_TrueColorImage
|
||||||
**/
|
**/
|
||||||
abstract public function asTrueColor();
|
abstract public function asTrueColor();
|
||||||
@@ -933,7 +933,7 @@
|
|||||||
*
|
*
|
||||||
* @param int $nColors Number of colors in the resulting image, more than 0, less or equal to 255
|
* @param int $nColors Number of colors in the resulting image, more than 0, less or equal to 255
|
||||||
* @param bool $dither Use dithering or not
|
* @param bool $dither Use dithering or not
|
||||||
* @param bool $matchPalette Set to true to use imagecolormatch() to match the resulting palette more closely to the original image
|
* @param bool $matchPalette Set to true to use imagecolormatch() to match the resulting palette more closely to the original image
|
||||||
*
|
*
|
||||||
* @return WideImage_Image
|
* @return WideImage_Image
|
||||||
**/
|
**/
|
||||||
@@ -941,28 +941,28 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieve an image with selected channels.
|
* Retrieve an image with selected channels.
|
||||||
*
|
*
|
||||||
* Examples:
|
* Examples:
|
||||||
* <code>
|
* <code>
|
||||||
* $channels = $img->getChannels('red', 'blue');
|
* $channels = $img->getChannels('red', 'blue');
|
||||||
* $channels = $img->getChannels('alpha', 'green');
|
* $channels = $img->getChannels('alpha', 'green');
|
||||||
* $channels = $img->getChannels(array('green', 'blue'));
|
* $channels = $img->getChannels(array('green', 'blue'));
|
||||||
* </code>
|
* </code>
|
||||||
*
|
*
|
||||||
* @return WideImage_Image
|
* @return WideImage_Image
|
||||||
**/
|
**/
|
||||||
abstract public function getChannels();
|
abstract public function getChannels();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns an image without an alpha channel.
|
* Returns an image without an alpha channel.
|
||||||
*
|
*
|
||||||
* @return WideImage_Image
|
* @return WideImage_Image
|
||||||
**/
|
**/
|
||||||
abstract public function copyNoAlpha();
|
abstract public function copyNoAlpha();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns an array of serializable protected variables. Called automatically upon serialize().
|
* Returns an array of serializable protected variables. Called automatically upon serialize().
|
||||||
*
|
*
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
public function __sleep()
|
public function __sleep()
|
||||||
|
@@ -29,7 +29,7 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a mapper, based on the $uri and $format.
|
* Returns a mapper, based on the $uri and $format.
|
||||||
*
|
*
|
||||||
* @param string $uri File URI
|
* @param string $uri File URI
|
||||||
* @param string $format File format (extension or mime-type) or null
|
* @param string $format File format (extension or mime-type) or null
|
||||||
*
|
*
|
||||||
|
@@ -11,7 +11,7 @@
|
|||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Executes the auto-crop operation on the $img.
|
* Executes the auto-crop operation on the $img.
|
||||||
*
|
*
|
||||||
* @param WideImage_Image $img
|
* @param WideImage_Image $img
|
||||||
* @param int $rgb_threshold The difference in RGB from $base_color
|
* @param int $rgb_threshold The difference in RGB from $base_color
|
||||||
* @param int $pixel_cutoff The number of pixels on each border that must be over $rgb_threshold
|
* @param int $pixel_cutoff The number of pixels on each border that must be over $rgb_threshold
|
||||||
|
@@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* CopyChannelsPalette operation class.
|
* CopyChannelsPalette operation class.
|
||||||
*
|
*
|
||||||
* This operation is intended to be used on palette images
|
* This operation is intended to be used on palette images
|
||||||
*/
|
*/
|
||||||
class WideImage_Operation_CopyChannelsPalette
|
class WideImage_Operation_CopyChannelsPalette
|
||||||
|
@@ -6,14 +6,14 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* CopyChannelsTrueColor operation class.
|
* CopyChannelsTrueColor operation class.
|
||||||
*
|
*
|
||||||
* Used to perform CopyChannels operation on truecolor images
|
* Used to perform CopyChannels operation on truecolor images
|
||||||
*/
|
*/
|
||||||
class WideImage_Operation_CopyChannelsTrueColor
|
class WideImage_Operation_CopyChannelsTrueColor
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Returns an image with only specified channels copied.
|
* Returns an image with only specified channels copied.
|
||||||
*
|
*
|
||||||
* @param WideImage_Image $img
|
* @param WideImage_Image $img
|
||||||
* @param array $channels
|
* @param array $channels
|
||||||
*
|
*
|
||||||
|
@@ -11,7 +11,7 @@
|
|||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Returns an image with a resized canvas.
|
* Returns an image with a resized canvas.
|
||||||
*
|
*
|
||||||
* The image is filled with $color. Use $scale to determine, when to resize.
|
* The image is filled with $color. Use $scale to determine, when to resize.
|
||||||
*
|
*
|
||||||
* @param WideImage_Image $img
|
* @param WideImage_Image $img
|
||||||
|
@@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Unsharp filter.
|
* Unsharp filter.
|
||||||
*
|
*
|
||||||
* This filter was taken from http://vikjavev.no/computing/ump.php,
|
* This filter was taken from http://vikjavev.no/computing/ump.php,
|
||||||
* the original author Torstein Hønsi. Adapted to fit better within
|
* the original author Torstein Hønsi. Adapted to fit better within
|
||||||
* the Wideimage package.
|
* the Wideimage package.
|
||||||
|
@@ -3,9 +3,6 @@
|
|||||||
* @author Gasper Kozak
|
* @author Gasper Kozak
|
||||||
* @copyright 2007-2011
|
* @copyright 2007-2011
|
||||||
**/
|
**/
|
||||||
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
class WideImage_UnknownImageOperationException extends WideImage_Exception
|
class WideImage_UnknownImageOperationException extends WideImage_Exception
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
@@ -3,9 +3,6 @@
|
|||||||
* @author Gasper Kozak
|
* @author Gasper Kozak
|
||||||
* @copyright 2007-2011
|
* @copyright 2007-2011
|
||||||
**/
|
**/
|
||||||
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
class WideImage_PaletteImage extends WideImage_Image
|
class WideImage_PaletteImage extends WideImage_Image
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
@@ -52,7 +49,7 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a copy of the image.
|
* Returns a copy of the image.
|
||||||
*
|
*
|
||||||
* @param $trueColor True if the new image should be truecolor
|
* @param $trueColor True if the new image should be truecolor
|
||||||
*
|
*
|
||||||
* @return WideImage_Image
|
* @return WideImage_Image
|
||||||
|
@@ -74,7 +74,7 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Allocates a color and returns its index.
|
* Allocates a color and returns its index.
|
||||||
*
|
*
|
||||||
* This method accepts either each component as an integer value,
|
* This method accepts either each component as an integer value,
|
||||||
* or an associative array that holds the color's components in keys
|
* or an associative array that holds the color's components in keys
|
||||||
* 'red', 'green', 'blue', 'alpha'.
|
* 'red', 'green', 'blue', 'alpha'.
|
||||||
|
@@ -18,20 +18,14 @@
|
|||||||
require_once WideImage::path().'Font/GDF.php';
|
require_once WideImage::path().'Font/GDF.php';
|
||||||
require_once WideImage::path().'Font/PS.php';
|
require_once WideImage::path().'Font/PS.php';
|
||||||
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
class WideImage_InvalidImageHandleException extends WideImage_Exception
|
class WideImage_InvalidImageHandleException extends WideImage_Exception
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
class WideImage_InvalidImageSourceException extends WideImage_Exception
|
class WideImage_InvalidImageSourceException extends WideImage_Exception
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
class WideImage_GDFunctionResultException extends WideImage_Exception
|
class WideImage_GDFunctionResultException extends WideImage_Exception
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@@ -92,12 +86,12 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Registers a custom mapper for image loading and saving.
|
* Registers a custom mapper for image loading and saving.
|
||||||
*
|
*
|
||||||
* Example:
|
* Example:
|
||||||
* <code>
|
* <code>
|
||||||
* WideImage::registerCustomMapper('WideImage_Mapper_TGA', 'image/tga', 'tga');
|
* WideImage::registerCustomMapper('WideImage_Mapper_TGA', 'image/tga', 'tga');
|
||||||
* </code>
|
* </code>
|
||||||
*
|
*
|
||||||
* @param string $mapper_class_name
|
* @param string $mapper_class_name
|
||||||
* @param string $mime_type
|
* @param string $mime_type
|
||||||
* @param string $extension
|
* @param string $extension
|
||||||
@@ -109,18 +103,18 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Loads an image from a file, URL, HTML input file field, binary string, or a valid image handle.
|
* Loads an image from a file, URL, HTML input file field, binary string, or a valid image handle.
|
||||||
* The image format is auto-detected.
|
* The image format is auto-detected.
|
||||||
*
|
*
|
||||||
* Currently supported formats: PNG, GIF, JPG, BMP, TGA, GD, GD2.
|
* Currently supported formats: PNG, GIF, JPG, BMP, TGA, GD, GD2.
|
||||||
*
|
*
|
||||||
* This function analyzes the input and decides whether to use WideImage::loadFromHandle(),
|
* This function analyzes the input and decides whether to use WideImage::loadFromHandle(),
|
||||||
* WideImage::loadFromFile(), WideImage::loadFromUpload() or WideImage::loadFromString(),
|
* WideImage::loadFromFile(), WideImage::loadFromUpload() or WideImage::loadFromString(),
|
||||||
* all of which you can also call directly to spare WideImage some guessing.
|
* all of which you can also call directly to spare WideImage some guessing.
|
||||||
*
|
*
|
||||||
* Arrays are supported for upload fields; it returns an array of loaded images.
|
* Arrays are supported for upload fields; it returns an array of loaded images.
|
||||||
* To load only a single image from an array field, use WideImage::loadFromUpload('img', $i),
|
* To load only a single image from an array field, use WideImage::loadFromUpload('img', $i),
|
||||||
* where $i is the index of the image you want to load.
|
* where $i is the index of the image you want to load.
|
||||||
*
|
*
|
||||||
* <code>
|
* <code>
|
||||||
* $img = WideImage::load('http://url/image.png'); // image URL
|
* $img = WideImage::load('http://url/image.png'); // image URL
|
||||||
* $img = WideImage::load('/path/to/image.png'); // local file path
|
* $img = WideImage::load('/path/to/image.png'); // local file path
|
||||||
@@ -128,7 +122,7 @@
|
|||||||
* $img = WideImage::load(imagecreatetruecolor(10, 10)); // a GD resource
|
* $img = WideImage::load(imagecreatetruecolor(10, 10)); // a GD resource
|
||||||
* $img = WideImage::load($image_data); // binary string containing image data
|
* $img = WideImage::load($image_data); // binary string containing image data
|
||||||
* </code>
|
* </code>
|
||||||
*
|
*
|
||||||
* @param mixed $source File name, url, HTML file input field name, binary string, or a GD image resource
|
* @param mixed $source File name, url, HTML file input field name, binary string, or a GD image resource
|
||||||
*
|
*
|
||||||
* @return WideImage_Image WideImage_PaletteImage or WideImage_TrueColorImage instance
|
* @return WideImage_Image WideImage_PaletteImage or WideImage_TrueColorImage instance
|
||||||
@@ -175,7 +169,7 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Create and load an image from a file or URL. The image format is auto-detected.
|
* Create and load an image from a file or URL. The image format is auto-detected.
|
||||||
*
|
*
|
||||||
* @param string $uri File or url
|
* @param string $uri File or url
|
||||||
*
|
*
|
||||||
* @return WideImage_Image WideImage_PaletteImage or WideImage_TrueColorImage instance
|
* @return WideImage_Image WideImage_PaletteImage or WideImage_TrueColorImage instance
|
||||||
@@ -217,7 +211,7 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Create and load an image from a string. Format is auto-detected.
|
* Create and load an image from a string. Format is auto-detected.
|
||||||
*
|
*
|
||||||
* @param string $string Binary data, i.e. from BLOB field in the database
|
* @param string $string Binary data, i.e. from BLOB field in the database
|
||||||
*
|
*
|
||||||
* @return WideImage_Image WideImage_PaletteImage or WideImage_TrueColorImage instance
|
* @return WideImage_Image WideImage_PaletteImage or WideImage_TrueColorImage instance
|
||||||
@@ -249,19 +243,19 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Create and load an image from an image handle.
|
* Create and load an image from an image handle.
|
||||||
*
|
*
|
||||||
* <b>Note:</b> the resulting image object takes ownership of the passed
|
* <b>Note:</b> the resulting image object takes ownership of the passed
|
||||||
* handle. When the newly-created image object is destroyed, the handle is
|
* handle. When the newly-created image object is destroyed, the handle is
|
||||||
* destroyed too, so it's not a valid image handle anymore. In order to
|
* destroyed too, so it's not a valid image handle anymore. In order to
|
||||||
* preserve the handle for use after object destruction, you have to call
|
* preserve the handle for use after object destruction, you have to call
|
||||||
* WideImage_Image::releaseHandle() on the created image instance prior to its
|
* WideImage_Image::releaseHandle() on the created image instance prior to its
|
||||||
* destruction.
|
* destruction.
|
||||||
*
|
*
|
||||||
* <code>
|
* <code>
|
||||||
* $handle = imagecreatefrompng('file.png');
|
* $handle = imagecreatefrompng('file.png');
|
||||||
* $image = WideImage::loadFromHandle($handle);
|
* $image = WideImage::loadFromHandle($handle);
|
||||||
* </code>
|
* </code>
|
||||||
*
|
*
|
||||||
* @param resource $handle A valid GD image resource
|
* @param resource $handle A valid GD image resource
|
||||||
*
|
*
|
||||||
* @return WideImage_Image WideImage_PaletteImage or WideImage_TrueColorImage instance
|
* @return WideImage_Image WideImage_PaletteImage or WideImage_TrueColorImage instance
|
||||||
@@ -281,11 +275,11 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* This method loads a file from the $_FILES array. The image format is auto-detected.
|
* This method loads a file from the $_FILES array. The image format is auto-detected.
|
||||||
*
|
*
|
||||||
* You only have to pass the field name as the parameter. For array fields, this function will
|
* You only have to pass the field name as the parameter. For array fields, this function will
|
||||||
* return an array of image objects, unless you specify the $index parameter, which will
|
* return an array of image objects, unless you specify the $index parameter, which will
|
||||||
* load the desired image.
|
* load the desired image.
|
||||||
*
|
*
|
||||||
* @param $field_name Name of the key in $_FILES array
|
* @param $field_name Name of the key in $_FILES array
|
||||||
* @param int $index The index of the file to load (if the input field is an array)
|
* @param int $index The index of the file to load (if the input field is an array)
|
||||||
*
|
*
|
||||||
@@ -321,7 +315,7 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Factory method for creating a palette image.
|
* Factory method for creating a palette image.
|
||||||
*
|
*
|
||||||
* @param int $width
|
* @param int $width
|
||||||
* @param int $height
|
* @param int $height
|
||||||
*
|
*
|
||||||
@@ -334,7 +328,7 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Factory method for creating a true-color image.
|
* Factory method for creating a true-color image.
|
||||||
*
|
*
|
||||||
* @param int $width
|
* @param int $width
|
||||||
* @param int $height
|
* @param int $height
|
||||||
*
|
*
|
||||||
@@ -347,7 +341,7 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Check whether the given handle is a valid GD resource.
|
* Check whether the given handle is a valid GD resource.
|
||||||
*
|
*
|
||||||
* @param mixed $handle The variable to check
|
* @param mixed $handle The variable to check
|
||||||
*
|
*
|
||||||
* @return bool
|
* @return bool
|
||||||
@@ -359,7 +353,7 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Throws exception if the handle isn't a valid GD resource.
|
* Throws exception if the handle isn't a valid GD resource.
|
||||||
*
|
*
|
||||||
* @param mixed $handle The variable to check
|
* @param mixed $handle The variable to check
|
||||||
*/
|
*/
|
||||||
public static function assertValidImageHandle($handle)
|
public static function assertValidImageHandle($handle)
|
||||||
|
@@ -1,10 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
|
||||||
|
|
||||||
**/
|
|
||||||
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
class WideImage_Canvas_Test extends WideImage_TestCase
|
class WideImage_Canvas_Test extends WideImage_TestCase
|
||||||
{
|
{
|
||||||
public function testCreate()
|
public function testCreate()
|
||||||
|
@@ -2,9 +2,6 @@
|
|||||||
/**
|
/**
|
||||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
**/
|
**/
|
||||||
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
class WideImage_Coordinate_Test extends WideImage_TestCase
|
class WideImage_Coordinate_Test extends WideImage_TestCase
|
||||||
{
|
{
|
||||||
public function testEvaluate()
|
public function testEvaluate()
|
||||||
|
@@ -1,10 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
|
||||||
|
|
||||||
**/
|
|
||||||
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
class WideImage_Operation_CustomOp
|
class WideImage_Operation_CustomOp
|
||||||
{
|
{
|
||||||
public static $args = null;
|
public static $args = null;
|
||||||
@@ -17,8 +13,6 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
class ImageForOutput extends WideImage_TrueColorImage
|
class ImageForOutput extends WideImage_TrueColorImage
|
||||||
{
|
{
|
||||||
public $headers = [];
|
public $headers = [];
|
||||||
@@ -29,8 +23,6 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
class TestableImage extends WideImage_TrueColorImage
|
class TestableImage extends WideImage_TrueColorImage
|
||||||
{
|
{
|
||||||
public $headers = [];
|
public $headers = [];
|
||||||
@@ -45,8 +37,6 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
class WideImage_Image_Test extends WideImage_TestCase
|
class WideImage_Image_Test extends WideImage_TestCase
|
||||||
{
|
{
|
||||||
public function testFactories()
|
public function testFactories()
|
||||||
|
@@ -1,11 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
|
||||||
|
|
||||||
**/
|
|
||||||
include WideImage::path().'Mapper/BMP.php';
|
include WideImage::path().'Mapper/BMP.php';
|
||||||
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
class WideImage_Mapper_BMP_Test extends WideImage_TestCase
|
class WideImage_Mapper_BMP_Test extends WideImage_TestCase
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
|
@@ -1,11 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
|
||||||
|
|
||||||
**/
|
|
||||||
include WideImage::path().'Mapper/GD2.php';
|
include WideImage::path().'Mapper/GD2.php';
|
||||||
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
class WideImage_Mapper_GD2_Test extends WideImage_TestCase
|
class WideImage_Mapper_GD2_Test extends WideImage_TestCase
|
||||||
{
|
{
|
||||||
protected $mapper;
|
protected $mapper;
|
||||||
|
@@ -1,11 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
|
||||||
|
|
||||||
**/
|
|
||||||
include WideImage::path().'Mapper/GD.php';
|
include WideImage::path().'Mapper/GD.php';
|
||||||
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
class WideImage_Mapper_GD_Test extends WideImage_TestCase
|
class WideImage_Mapper_GD_Test extends WideImage_TestCase
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
|
@@ -1,7 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
|
||||||
|
|
||||||
**/
|
|
||||||
include WideImage::path().'Mapper/GIF.php';
|
include WideImage::path().'Mapper/GIF.php';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -1,11 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
|
||||||
|
|
||||||
**/
|
|
||||||
include WideImage::path().'Mapper/JPEG.php';
|
include WideImage::path().'Mapper/JPEG.php';
|
||||||
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
class WideImage_Mapper_JPEG_Test extends WideImage_TestCase
|
class WideImage_Mapper_JPEG_Test extends WideImage_TestCase
|
||||||
{
|
{
|
||||||
protected $mapper;
|
protected $mapper;
|
||||||
|
@@ -1,11 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
|
||||||
|
|
||||||
**/
|
|
||||||
include WideImage::path().'Mapper/PNG.php';
|
include WideImage::path().'Mapper/PNG.php';
|
||||||
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
class WideImage_Mapper_PNG_Test extends WideImage_TestCase
|
class WideImage_Mapper_PNG_Test extends WideImage_TestCase
|
||||||
{
|
{
|
||||||
protected $mapper;
|
protected $mapper;
|
||||||
|
@@ -1,7 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
|
||||||
|
|
||||||
**/
|
|
||||||
include WideImage::path().'Mapper/TGA.php';
|
include WideImage::path().'Mapper/TGA.php';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -1,10 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
|
||||||
|
|
||||||
**/
|
|
||||||
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
class WideImage_MapperFactory_Test extends WideImage_TestCase
|
class WideImage_MapperFactory_Test extends WideImage_TestCase
|
||||||
{
|
{
|
||||||
public function testMapperPNGByURI()
|
public function testMapperPNGByURI()
|
||||||
|
@@ -1,7 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
|
||||||
|
|
||||||
**/
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @group operation
|
* @group operation
|
||||||
|
@@ -1,7 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
|
||||||
|
|
||||||
**/
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @group operation
|
* @group operation
|
||||||
|
@@ -1,10 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
|
||||||
|
|
||||||
**/
|
|
||||||
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
class WideImage_Operation_ApplyMask_Test extends WideImage_TestCase
|
class WideImage_Operation_ApplyMask_Test extends WideImage_TestCase
|
||||||
{
|
{
|
||||||
public function testApplyMask()
|
public function testApplyMask()
|
||||||
|
@@ -1,10 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
|
||||||
|
|
||||||
**/
|
|
||||||
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
class WideImage_Operation_AsGrayscale_Test extends WideImage_TestCase
|
class WideImage_Operation_AsGrayscale_Test extends WideImage_TestCase
|
||||||
{
|
{
|
||||||
public function skip()
|
public function skip()
|
||||||
|
@@ -1,10 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
|
||||||
|
|
||||||
**/
|
|
||||||
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
class WideImage_Operation_AsNegativeTest extends WideImage_TestCase
|
class WideImage_Operation_AsNegativeTest extends WideImage_TestCase
|
||||||
{
|
{
|
||||||
public function skip()
|
public function skip()
|
||||||
|
@@ -1,10 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
|
||||||
|
|
||||||
**/
|
|
||||||
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
class WideImage_Operation_Autocrop_Test extends WideImage_TestCase
|
class WideImage_Operation_Autocrop_Test extends WideImage_TestCase
|
||||||
{
|
{
|
||||||
public function testAutocrop()
|
public function testAutocrop()
|
||||||
|
@@ -1,7 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
|
||||||
|
|
||||||
**/
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @group operation
|
* @group operation
|
||||||
|
@@ -1,10 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
|
||||||
|
|
||||||
**/
|
|
||||||
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
class WideImage_Operation_Crop_Test extends WideImage_TestCase
|
class WideImage_Operation_Crop_Test extends WideImage_TestCase
|
||||||
{
|
{
|
||||||
public function testCropTransparentGif()
|
public function testCropTransparentGif()
|
||||||
|
@@ -1,10 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
|
||||||
|
|
||||||
**/
|
|
||||||
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
class FlipTest extends WideImage_TestCase
|
class FlipTest extends WideImage_TestCase
|
||||||
{
|
{
|
||||||
public function testFlip()
|
public function testFlip()
|
||||||
|
@@ -1,10 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
|
||||||
|
|
||||||
**/
|
|
||||||
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
class WideImage_Operation_GetChannels_Test extends WideImage_TestCase
|
class WideImage_Operation_GetChannels_Test extends WideImage_TestCase
|
||||||
{
|
{
|
||||||
public function testCopyChannel8bit()
|
public function testCopyChannel8bit()
|
||||||
@@ -73,7 +69,7 @@
|
|||||||
$this->assertRGBEqual($copy->getRGBAt(85, 85), 0, 255, 0);
|
$this->assertRGBEqual($copy->getRGBAt(85, 85), 0, 255, 0);
|
||||||
$this->assertRGBEqual($copy->getRGBAt(15, 85), 0, 255, 0);
|
$this->assertRGBEqual($copy->getRGBAt(15, 85), 0, 255, 0);
|
||||||
$this->assertRGBEqual($copy->getRGBAt(50, 50), 0, 127, 0);
|
$this->assertRGBEqual($copy->getRGBAt(50, 50), 0, 127, 0);
|
||||||
|
|
||||||
$copy = $img->copyChannels('blue');
|
$copy = $img->copyChannels('blue');
|
||||||
$this->assertFalse($img->getHandle() === $copy->getHandle());
|
$this->assertFalse($img->getHandle() === $copy->getHandle());
|
||||||
$this->assertTrue($copy instanceof WideImage_TrueColorImage);
|
$this->assertTrue($copy instanceof WideImage_TrueColorImage);
|
||||||
@@ -84,7 +80,7 @@
|
|||||||
$this->assertRGBEqual($copy->getRGBAt(85, 85), 0, 0, 0);
|
$this->assertRGBEqual($copy->getRGBAt(85, 85), 0, 0, 0);
|
||||||
$this->assertRGBEqual($copy->getRGBAt(15, 85), 0, 0, 0);
|
$this->assertRGBEqual($copy->getRGBAt(15, 85), 0, 0, 0);
|
||||||
$this->assertRGBEqual($copy->getRGBAt(50, 50), 0, 0, 127);
|
$this->assertRGBEqual($copy->getRGBAt(50, 50), 0, 0, 127);
|
||||||
|
|
||||||
$img = WideImage::load(IMG_PATH . '100x100-blue-alpha.png');
|
$img = WideImage::load(IMG_PATH . '100x100-blue-alpha.png');
|
||||||
$copy = $img->copyChannels('alpha');
|
$copy = $img->copyChannels('alpha');
|
||||||
$this->assertRGBNear($copy->getRGBAt(25, 25), 0, 0, 0, 0.25 * 127);
|
$this->assertRGBNear($copy->getRGBAt(25, 25), 0, 0, 0, 0.25 * 127);
|
||||||
|
@@ -1,10 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
|
||||||
|
|
||||||
**/
|
|
||||||
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
class WideImage_Operation_GetMask_Test extends WideImage_TestCase
|
class WideImage_Operation_GetMask_Test extends WideImage_TestCase
|
||||||
{
|
{
|
||||||
public function testGetMaskTransparentGif()
|
public function testGetMaskTransparentGif()
|
||||||
|
@@ -1,7 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
|
||||||
|
|
||||||
**/
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @group operation
|
* @group operation
|
||||||
|
@@ -1,10 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
|
||||||
|
|
||||||
**/
|
|
||||||
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
class WideImage_Operation_Mirror_Test extends WideImage_TestCase
|
class WideImage_Operation_Mirror_Test extends WideImage_TestCase
|
||||||
{
|
{
|
||||||
public function testMirror()
|
public function testMirror()
|
||||||
|
@@ -1,11 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
|
||||||
|
|
||||||
**/
|
|
||||||
WideImage_OperationFactory::get('ResizeCanvas');
|
WideImage_OperationFactory::get('ResizeCanvas');
|
||||||
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
class WideImage_Operation_ResizeCanvas_Test extends WideImage_TestCase
|
class WideImage_Operation_ResizeCanvas_Test extends WideImage_TestCase
|
||||||
{
|
{
|
||||||
public function testResizeCanvasUp()
|
public function testResizeCanvasUp()
|
||||||
|
@@ -1,7 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
|
||||||
|
|
||||||
**/
|
|
||||||
WideImage_OperationFactory::get('Resize');
|
WideImage_OperationFactory::get('Resize');
|
||||||
|
|
||||||
class WideImage_Operation_Resize_Testable extends WideImage_Operation_Resize
|
class WideImage_Operation_Resize_Testable extends WideImage_Operation_Resize
|
||||||
@@ -12,8 +10,6 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
class WideImage_Operation_Resize_Test extends WideImage_TestCase
|
class WideImage_Operation_Resize_Test extends WideImage_TestCase
|
||||||
{
|
{
|
||||||
public function testProxyMethod()
|
public function testProxyMethod()
|
||||||
|
@@ -1,10 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
|
||||||
|
|
||||||
**/
|
|
||||||
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
class WideImage_Operation_Rotate_Test extends WideImage_TestCase
|
class WideImage_Operation_Rotate_Test extends WideImage_TestCase
|
||||||
{
|
{
|
||||||
public function skip()
|
public function skip()
|
||||||
|
@@ -1,7 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
|
||||||
|
|
||||||
**/
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @group operation
|
* @group operation
|
||||||
|
@@ -1,7 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
|
||||||
|
|
||||||
**/
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @group operation
|
* @group operation
|
||||||
|
@@ -1,16 +1,10 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
|
||||||
|
|
||||||
**/
|
|
||||||
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
class WideImage_Operation_MyOperation
|
class WideImage_Operation_MyOperation
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
class WideImage_OperationFactory_Test extends WideImage_TestCase
|
class WideImage_OperationFactory_Test extends WideImage_TestCase
|
||||||
{
|
{
|
||||||
public function testFactoryReturnsCached()
|
public function testFactoryReturnsCached()
|
||||||
|
@@ -1,10 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
|
||||||
|
|
||||||
**/
|
|
||||||
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
class WideImage_PaletteImage_Test extends WideImage_TestCase
|
class WideImage_PaletteImage_Test extends WideImage_TestCase
|
||||||
{
|
{
|
||||||
public function testCreate()
|
public function testCreate()
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user