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