mirror of
https://github.com/mosbth/cimage.git
synced 2025-07-31 13:40:08 +02:00
updating phpdoc
This commit is contained in:
@@ -111,7 +111,7 @@
|
||||
</li>
|
||||
<li>
|
||||
<a href="../reports/markers.html">
|
||||
<i class="icon-list-alt"></i> Markers <span class="label label-info pull-right">165</span>
|
||||
<i class="icon-list-alt"></i> Markers <span class="label label-info pull-right">164</span>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
@@ -136,10 +136,10 @@
|
||||
<div class="accordion" style="margin-bottom: 0">
|
||||
<div class="accordion-group">
|
||||
<div class="accordion-heading">
|
||||
<a class="accordion-toggle " data-toggle="collapse" data-target="#namespace-890509294"></a>
|
||||
<a class="accordion-toggle " data-toggle="collapse" data-target="#namespace-1983965054"></a>
|
||||
<a href="../namespaces/default.html" style="margin-left: 30px; padding-left: 0">\</a>
|
||||
</div>
|
||||
<div id="namespace-890509294" class="accordion-body collapse in">
|
||||
<div id="namespace-1983965054" class="accordion-body collapse in">
|
||||
<div class="accordion-inner">
|
||||
|
||||
|
||||
@@ -727,7 +727,7 @@
|
||||
<section class="span10 offset1">
|
||||
<hr />
|
||||
Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor </a> and authored
|
||||
on March 4th, 2015 at 10:52.
|
||||
on March 6th, 2015 at 12:38.
|
||||
</section>
|
||||
</section>
|
||||
</section>
|
||||
|
@@ -111,7 +111,7 @@
|
||||
</li>
|
||||
<li>
|
||||
<a href="../reports/markers.html">
|
||||
<i class="icon-list-alt"></i> Markers <span class="label label-info pull-right">165</span>
|
||||
<i class="icon-list-alt"></i> Markers <span class="label label-info pull-right">164</span>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
@@ -136,10 +136,10 @@
|
||||
<div class="accordion" style="margin-bottom: 0">
|
||||
<div class="accordion-group">
|
||||
<div class="accordion-heading">
|
||||
<a class="accordion-toggle " data-toggle="collapse" data-target="#namespace-1385228821"></a>
|
||||
<a class="accordion-toggle " data-toggle="collapse" data-target="#namespace-828328770"></a>
|
||||
<a href="../namespaces/default.html" style="margin-left: 30px; padding-left: 0">\</a>
|
||||
</div>
|
||||
<div id="namespace-1385228821" class="accordion-body collapse in">
|
||||
<div id="namespace-828328770" class="accordion-body collapse in">
|
||||
<div class="accordion-inner">
|
||||
|
||||
|
||||
@@ -254,7 +254,7 @@
|
||||
</section>
|
||||
<section class="row-fluid protected">
|
||||
<section class="span4">
|
||||
<em>No protected methods found</em>
|
||||
<a href="../classes/CImage.html#method_getTargetImageExtension" class="">getTargetImageExtension()</a><br />
|
||||
</section>
|
||||
<section class="span4">
|
||||
<em>No protected properties found</em>
|
||||
@@ -286,7 +286,7 @@
|
||||
<a href="../classes/CImage.html#property_imageFolder" class="">$imageFolder</a><br />
|
||||
<a href="../classes/CImage.html#property_imageSrc" class="">$imageSrc</a><br />
|
||||
<a href="../classes/CImage.html#property_pathToImage" class="">$pathToImage</a><br />
|
||||
<a href="../classes/CImage.html#property_fileExtension" class="">$fileExtension</a><br />
|
||||
<a href="../classes/CImage.html#property_fileType" class="">$fileType</a><br />
|
||||
<a href="../classes/CImage.html#property_extension" class="">$extension</a><br />
|
||||
<a href="../classes/CImage.html#property_outputFormat" class="">$outputFormat</a><br />
|
||||
<a href="../classes/CImage.html#property_verbose" class="">$verbose</a><br />
|
||||
@@ -987,11 +987,11 @@ decides (partly) what properties are created.</em></p>
|
||||
|
||||
<div class="row-fluid">
|
||||
<div class="span8 content class">
|
||||
<a id="property_fileExtension" name="property_fileExtension" class="anchor"></a>
|
||||
<a id="property_fileType" name="property_fileType" class="anchor"></a>
|
||||
<article class="property">
|
||||
<h3 class="private ">$fileExtension</h3>
|
||||
<pre class="signature">$fileExtension : </pre>
|
||||
<p><em>Original file extension</em></p>
|
||||
<h3 class="private ">$fileType</h3>
|
||||
<pre class="signature">$fileType : </pre>
|
||||
<p><em>File type for source image, as provided by getimagesize()</em></p>
|
||||
|
||||
|
||||
<h4>Type</h4>
|
||||
@@ -2621,7 +2621,7 @@ processing can be done.</em></p>
|
||||
<h3 class="public ">failedToLoad()</h3>
|
||||
<a href="#source-view" role="button" class="pull-right btn" data-toggle="modal" style="font-size: 1.1em; padding: 9px 14px"><i class="icon-code"></i></a>
|
||||
<pre class="signature" style="margin-right: 54px;">failedToLoad() : void</pre>
|
||||
<p><em>Error message when failing to load somehow corrupt image.</em></p>
|
||||
<p><em>To display error message when failing to load somehow corrupt image.</em></p>
|
||||
|
||||
|
||||
|
||||
@@ -2647,7 +2647,8 @@ processing can be done.</em></p>
|
||||
<h3 class="public ">load()</h3>
|
||||
<a href="#source-view" role="button" class="pull-right btn" data-toggle="modal" style="font-size: 1.1em; padding: 9px 14px"><i class="icon-code"></i></a>
|
||||
<pre class="signature" style="margin-right: 54px;">load(string <span class="argument">$src = null</span>, string <span class="argument">$dir = null</span>) : $this</pre>
|
||||
<p><em>Load image from disk.</em></p>
|
||||
<p><em>Load image from disk. Try to load image without verbose error message,
|
||||
if fail, load again and display error messages.</em></p>
|
||||
|
||||
|
||||
<h4>Parameters</h4>
|
||||
@@ -3319,7 +3320,36 @@ alpha 00000000-FFFFFF7F.</em></p>
|
||||
</aside>
|
||||
</div>
|
||||
|
||||
<div class="row-fluid">
|
||||
<div class="row-fluid">
|
||||
<div class="span8 content class">
|
||||
<a id="method_getTargetImageExtension" name="method_getTargetImageExtension" class="anchor"></a>
|
||||
<article class="method">
|
||||
<h3 class="protected ">getTargetImageExtension()</h3>
|
||||
<a href="#source-view" role="button" class="pull-right btn" data-toggle="modal" style="font-size: 1.1em; padding: 9px 14px"><i class="icon-code"></i></a>
|
||||
<pre class="signature" style="margin-right: 54px;">getTargetImageExtension() : string</pre>
|
||||
<p><em>Find out the type (file extension) for the image to be saved.</em></p>
|
||||
|
||||
|
||||
|
||||
|
||||
<h4>Returns</h4>
|
||||
string
|
||||
— <p>as image extension.</p>
|
||||
|
||||
</article>
|
||||
</div>
|
||||
<aside class="span4 detailsbar">
|
||||
<h1><i class="icon-arrow-down"></i></h1>
|
||||
<dl>
|
||||
</dl>
|
||||
<h2>Tags</h2>
|
||||
<table class="table table-condensed">
|
||||
<tr><td colspan="2"><em>None found</em></td></tr>
|
||||
</table>
|
||||
</aside>
|
||||
</div>
|
||||
|
||||
<div class="row-fluid">
|
||||
<div class="span8 content class">
|
||||
<a id="method_checkFileExtension" name="method_checkFileExtension" class="anchor"></a>
|
||||
<article class="method">
|
||||
@@ -3655,7 +3685,7 @@ alpha 00000000-FFFFFF7F.</em></p>
|
||||
<section class="span10 offset1">
|
||||
<hr />
|
||||
Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor </a> and authored
|
||||
on March 4th, 2015 at 10:52.
|
||||
on March 6th, 2015 at 12:38.
|
||||
</section>
|
||||
</section>
|
||||
</section>
|
||||
|
@@ -111,7 +111,7 @@
|
||||
</li>
|
||||
<li>
|
||||
<a href="../reports/markers.html">
|
||||
<i class="icon-list-alt"></i> Markers <span class="label label-info pull-right">165</span>
|
||||
<i class="icon-list-alt"></i> Markers <span class="label label-info pull-right">164</span>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
@@ -136,10 +136,10 @@
|
||||
<div class="accordion" style="margin-bottom: 0">
|
||||
<div class="accordion-group">
|
||||
<div class="accordion-heading">
|
||||
<a class="accordion-toggle " data-toggle="collapse" data-target="#namespace-1493472854"></a>
|
||||
<a class="accordion-toggle " data-toggle="collapse" data-target="#namespace-811883102"></a>
|
||||
<a href="../namespaces/default.html" style="margin-left: 30px; padding-left: 0">\</a>
|
||||
</div>
|
||||
<div id="namespace-1493472854" class="accordion-body collapse in">
|
||||
<div id="namespace-811883102" class="accordion-body collapse in">
|
||||
<div class="accordion-inner">
|
||||
|
||||
|
||||
@@ -976,7 +976,7 @@ a remote file.</em></p>
|
||||
<section class="span10 offset1">
|
||||
<hr />
|
||||
Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor </a> and authored
|
||||
on March 4th, 2015 at 10:52.
|
||||
on March 6th, 2015 at 12:38.
|
||||
</section>
|
||||
</section>
|
||||
</section>
|
||||
|
@@ -111,7 +111,7 @@
|
||||
</li>
|
||||
<li>
|
||||
<a href="../reports/markers.html">
|
||||
<i class="icon-list-alt"></i> Markers <span class="label label-info pull-right">165</span>
|
||||
<i class="icon-list-alt"></i> Markers <span class="label label-info pull-right">164</span>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
@@ -136,10 +136,10 @@
|
||||
<div class="accordion" style="margin-bottom: 0">
|
||||
<div class="accordion-group">
|
||||
<div class="accordion-heading">
|
||||
<a class="accordion-toggle " data-toggle="collapse" data-target="#namespace-567895557"></a>
|
||||
<a class="accordion-toggle " data-toggle="collapse" data-target="#namespace-470874282"></a>
|
||||
<a href="../namespaces/default.html" style="margin-left: 30px; padding-left: 0">\</a>
|
||||
</div>
|
||||
<div id="namespace-567895557" class="accordion-body collapse in">
|
||||
<div id="namespace-470874282" class="accordion-body collapse in">
|
||||
<div class="accordion-inner">
|
||||
|
||||
|
||||
@@ -413,7 +413,7 @@ whitelist should be a regexp without the surrounding / or #.</em></p>
|
||||
<section class="span10 offset1">
|
||||
<hr />
|
||||
Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor </a> and authored
|
||||
on March 4th, 2015 at 10:52.
|
||||
on March 6th, 2015 at 12:38.
|
||||
</section>
|
||||
</section>
|
||||
</section>
|
||||
|
@@ -111,7 +111,7 @@
|
||||
</li>
|
||||
<li>
|
||||
<a href="../reports/markers.html">
|
||||
<i class="icon-list-alt"></i> Markers <span class="label label-info pull-right">165</span>
|
||||
<i class="icon-list-alt"></i> Markers <span class="label label-info pull-right">164</span>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
@@ -136,10 +136,10 @@
|
||||
<div class="accordion" style="margin-bottom: 0">
|
||||
<div class="accordion-group">
|
||||
<div class="accordion-heading">
|
||||
<a class="accordion-toggle " data-toggle="collapse" data-target="#namespace-1761165334"></a>
|
||||
<a class="accordion-toggle " data-toggle="collapse" data-target="#namespace-785926434"></a>
|
||||
<a href="../namespaces/default.html" style="margin-left: 30px; padding-left: 0">\</a>
|
||||
</div>
|
||||
<div id="namespace-1761165334" class="accordion-body collapse in">
|
||||
<div id="namespace-785926434" class="accordion-body collapse in">
|
||||
<div class="accordion-inner">
|
||||
|
||||
|
||||
@@ -245,7 +245,7 @@
|
||||
<section class="span10 offset1">
|
||||
<hr />
|
||||
Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor </a> and authored
|
||||
on March 4th, 2015 at 10:52.
|
||||
on March 6th, 2015 at 12:38.
|
||||
</section>
|
||||
</section>
|
||||
</section>
|
||||
|
@@ -111,7 +111,7 @@
|
||||
</li>
|
||||
<li>
|
||||
<a href="../reports/markers.html">
|
||||
<i class="icon-list-alt"></i> Markers <span class="label label-info pull-right">165</span>
|
||||
<i class="icon-list-alt"></i> Markers <span class="label label-info pull-right">164</span>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
@@ -136,10 +136,10 @@
|
||||
<div class="accordion" style="margin-bottom: 0">
|
||||
<div class="accordion-group">
|
||||
<div class="accordion-heading">
|
||||
<a class="accordion-toggle " data-toggle="collapse" data-target="#namespace-14996055"></a>
|
||||
<a class="accordion-toggle " data-toggle="collapse" data-target="#namespace-163130442"></a>
|
||||
<a href="../namespaces/default.html" style="margin-left: 30px; padding-left: 0">\</a>
|
||||
</div>
|
||||
<div id="namespace-14996055" class="accordion-body collapse in">
|
||||
<div id="namespace-163130442" class="accordion-body collapse in">
|
||||
<div class="accordion-inner">
|
||||
|
||||
|
||||
@@ -245,7 +245,7 @@
|
||||
<section class="span10 offset1">
|
||||
<hr />
|
||||
Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor </a> and authored
|
||||
on March 4th, 2015 at 10:52.
|
||||
on March 6th, 2015 at 12:38.
|
||||
</section>
|
||||
</section>
|
||||
</section>
|
||||
|
@@ -135,9 +135,9 @@ class CImage
|
||||
|
||||
|
||||
/**
|
||||
* Original file extension
|
||||
* File type for source image, as provided by getimagesize()
|
||||
*/
|
||||
private $fileExtension;
|
||||
private $fileType;
|
||||
|
||||
|
||||
|
||||
@@ -513,6 +513,10 @@ class CImage
|
||||
*/
|
||||
public function downloadRemoteSource($src)
|
||||
{
|
||||
if (!$this->isRemoteSourceOnWhitelist($src)) {
|
||||
throw new Exception("Hostname is not on whitelist for remote sources.");
|
||||
}
|
||||
|
||||
$remote = new CRemoteImage();
|
||||
$cache = $this->saveFolder . "/remote/";
|
||||
|
||||
@@ -568,10 +572,6 @@ class CImage
|
||||
$this->imageSrc = ltrim($src, '/');
|
||||
$this->imageFolder = rtrim($dir, '/');
|
||||
$this->pathToImage = $this->imageFolder . '/' . $this->imageSrc;
|
||||
$this->fileExtension = strtolower(pathinfo($this->pathToImage, PATHINFO_EXTENSION));
|
||||
//$this->extension = $this->fileExtension;
|
||||
|
||||
$this->checkFileExtension($this->fileExtension);
|
||||
|
||||
return $this;
|
||||
}
|
||||
@@ -776,13 +776,14 @@ class CImage
|
||||
or $this->raiseError('Image file does not exist.');
|
||||
|
||||
// Get details on image
|
||||
$info = list($this->width, $this->height, $this->type, $this->attr) = getimagesize($file);
|
||||
$info = list($this->width, $this->height, $this->fileType, $this->attr) = getimagesize($file);
|
||||
!empty($info) or $this->raiseError("The file doesn't seem to be an image.");
|
||||
|
||||
if ($this->verbose) {
|
||||
$this->log("Image file: {$file}");
|
||||
$this->log("Image width x height (type): {$this->width} x {$this->height} ({$this->type}).");
|
||||
$this->log("Image filesize: " . filesize($file) . " bytes.");
|
||||
$this->log("Loading image details for: {$file}");
|
||||
$this->log(" Image width x height (type): {$this->width} x {$this->height} ({$this->fileType}).");
|
||||
$this->log(" Image filesize: " . filesize($file) . " bytes.");
|
||||
$this->log(" Image mimetype: " . image_type_to_mime_type($this->fileType));
|
||||
}
|
||||
|
||||
return $this;
|
||||
@@ -1047,7 +1048,7 @@ class CImage
|
||||
$this->extension = $saveAs;
|
||||
}
|
||||
|
||||
$this->log("Prepare to save image using as: " . $this->extension);
|
||||
$this->log("Prepare to save image as: " . $this->extension);
|
||||
|
||||
return $this;
|
||||
}
|
||||
@@ -1201,15 +1202,17 @@ class CImage
|
||||
|
||||
$this->extension = isset($this->extension)
|
||||
? $this->extension
|
||||
: $parts['extension'];
|
||||
: (isset($parts['extension'])
|
||||
? $parts['extension']
|
||||
: null);
|
||||
|
||||
$optimize = null;
|
||||
if ($this->extension == 'jpeg' || $this->extension == 'jpg') {
|
||||
$optimize = $this->jpegOptimize ? 'o' : null;
|
||||
} elseif ($this->extension == 'png') {
|
||||
$optimize .= $this->pngFilter ? 'f' : null;
|
||||
$optimize .= $this->pngDeflate ? 'd' : null;
|
||||
}
|
||||
$extension = empty($this->extension)
|
||||
? null
|
||||
: "." . $this->extension;
|
||||
|
||||
$optimize = $this->jpegOptimize ? 'o' : null;
|
||||
$optimize .= $this->pngFilter ? 'f' : null;
|
||||
$optimize .= $this->pngDeflate ? 'd' : null;
|
||||
|
||||
$convolve = null;
|
||||
if ($this->convolve) {
|
||||
@@ -1228,7 +1231,7 @@ class CImage
|
||||
. $crop_x . $crop_y . $upscale
|
||||
. $quality . $filters . $sharpen . $emboss . $blur . $palette . $optimize
|
||||
. $scale . $rotateBefore . $rotateAfter . $autoRotate . $bgColor . $convolve
|
||||
. '.' . $this->extension;
|
||||
. $extension;
|
||||
|
||||
return $this->setTarget($file, $base);
|
||||
}
|
||||
@@ -1271,7 +1274,7 @@ class CImage
|
||||
|
||||
|
||||
/**
|
||||
* Error message when failing to load somehow corrupt image.
|
||||
* To display error message when failing to load somehow corrupt image.
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
@@ -1280,29 +1283,15 @@ class CImage
|
||||
{
|
||||
header("HTTP/1.0 404 Not Found");
|
||||
echo("CImage.php says 404: Fatal error when opening image.<br>");
|
||||
|
||||
switch ($this->fileExtension) {
|
||||
case 'jpg':
|
||||
case 'jpeg':
|
||||
$this->image = imagecreatefromjpeg($this->pathToImage);
|
||||
break;
|
||||
|
||||
case 'gif':
|
||||
$this->image = imagecreatefromgif($this->pathToImage);
|
||||
break;
|
||||
|
||||
case 'png':
|
||||
$this->image = imagecreatefrompng($this->pathToImage);
|
||||
break;
|
||||
}
|
||||
|
||||
$image = imagecreatefromstring(file_get_contents($this->pathToImage));
|
||||
exit();
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Load image from disk.
|
||||
* Load image from disk. Try to load image without verbose error message,
|
||||
* if fail, load again and display error messages.
|
||||
*
|
||||
* @param string $src of image.
|
||||
* @param string $dir as base directory where images are.
|
||||
@@ -1316,46 +1305,30 @@ class CImage
|
||||
$this->setSource($src, $dir);
|
||||
}
|
||||
|
||||
$this->log("Opening file as {$this->fileExtension}.");
|
||||
$this->loadImageDetails($this->pathToImage);
|
||||
|
||||
switch ($this->fileExtension) {
|
||||
case 'jpg':
|
||||
case 'jpeg':
|
||||
$this->image = @imagecreatefromjpeg($this->pathToImage);
|
||||
$this->image or $this->failedToLoad();
|
||||
break;
|
||||
$this->image = @imagecreatefromstring(file_get_contents($this->pathToImage));
|
||||
$this->image or $this->failedToLoad();
|
||||
|
||||
case 'gif':
|
||||
$this->image = @imagecreatefromgif($this->pathToImage);
|
||||
$this->image or $this->failedToLoad();
|
||||
break;
|
||||
if (image_type_to_mime_type($this->fileType) == 'image/png') {
|
||||
$type = $this->getPngType();
|
||||
$hasFewColors = imagecolorstotal($this->image);
|
||||
|
||||
case 'png':
|
||||
$this->image = @imagecreatefrompng($this->pathToImage);
|
||||
$this->image or $this->failedToLoad();
|
||||
|
||||
$type = $this->getPngType();
|
||||
$hasFewColors = imagecolorstotal($this->image);
|
||||
|
||||
if ($type == self::PNG_RGB_PALETTE || ($hasFewColors > 0 && $hasFewColors <= 256)) {
|
||||
if ($this->verbose) {
|
||||
$this->log("Handle this image as a palette image.");
|
||||
}
|
||||
$this->palette = true;
|
||||
if ($type == self::PNG_RGB_PALETTE || ($hasFewColors > 0 && $hasFewColors <= 256)) {
|
||||
if ($this->verbose) {
|
||||
$this->log("Handle this image as a palette image.");
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
$this->image = false;
|
||||
throw new Exception('No support for this file extension.');
|
||||
$this->palette = true;
|
||||
}
|
||||
}
|
||||
|
||||
if ($this->verbose) {
|
||||
$this->log("imageistruecolor() : " . (imageistruecolor($this->image) ? 'true' : 'false'));
|
||||
$this->log("imagecolorstotal() : " . imagecolorstotal($this->image));
|
||||
$this->log("Number of colors in image = " . $this->colorsTotal($this->image));
|
||||
$this->log("Image successfully loaded from file.");
|
||||
$this->log(" imageistruecolor() : " . (imageistruecolor($this->image) ? 'true' : 'false'));
|
||||
$this->log(" imagecolorstotal() : " . imagecolorstotal($this->image));
|
||||
$this->log(" Number of colors in image = " . $this->colorsTotal($this->image));
|
||||
$index = imagecolortransparent($this->image);
|
||||
$this->log("Detected transparent color = " . ($index > 0 ? implode(", ", imagecolorsforindex($this->image, $index)) : "NONE") . " at index = $index");
|
||||
$this->log(" Detected transparent color = " . ($index > 0 ? implode(", ", imagecolorsforindex($this->image, $index)) : "NONE") . " at index = $index");
|
||||
}
|
||||
|
||||
return $this;
|
||||
@@ -1750,7 +1723,7 @@ class CImage
|
||||
*/
|
||||
public function rotateExif()
|
||||
{
|
||||
if (!in_array($this->fileExtension, array('jpg', 'jpeg'))) {
|
||||
if (!in_array($this->fileType, array(IMAGETYPE_JPEG, IMAGETYPE_TIFF_II, IMAGETYPE_TIFF_MM))) {
|
||||
$this->log("Autorotate ignored, EXIF not supported by this filetype.");
|
||||
return $this;
|
||||
}
|
||||
@@ -2094,6 +2067,22 @@ class CImage
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Find out the type (file extension) for the image to be saved.
|
||||
*
|
||||
* @return string as image extension.
|
||||
*/
|
||||
protected function getTargetImageExtension()
|
||||
{
|
||||
if (isset($this->extension)) {
|
||||
return strtolower($this->extension);
|
||||
} else {
|
||||
return image_type_to_extension($this->fileType);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Save image.
|
||||
*
|
||||
@@ -2111,7 +2100,7 @@ class CImage
|
||||
is_writable($this->saveFolder)
|
||||
or $this->raiseError('Target directory is not writable.');
|
||||
|
||||
switch(strtolower($this->extension)) {
|
||||
switch($this->getTargetImageExtension()) {
|
||||
|
||||
case 'jpeg':
|
||||
case 'jpg':
|
||||
@@ -2138,6 +2127,7 @@ class CImage
|
||||
break;
|
||||
|
||||
case 'png':
|
||||
default:
|
||||
$this->Log("Saving image as PNG to cache using compression = {$this->compress}.");
|
||||
|
||||
// Turn off alpha blending and set alpha flag
|
||||
@@ -2171,20 +2161,17 @@ class CImage
|
||||
$this->Log($res);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
$this->RaiseError('No support for this file extension.');
|
||||
break;
|
||||
}
|
||||
|
||||
if ($this->verbose) {
|
||||
clearstatcache();
|
||||
$this->log("Cached image filesize: " . filesize($this->cacheFileName) . " bytes.");
|
||||
$this->log("imageistruecolor() : " . (imageistruecolor($this->image) ? 'true' : 'false'));
|
||||
$this->log("imagecolorstotal() : " . imagecolorstotal($this->image));
|
||||
$this->log("Number of colors in image = " . $this->ColorsTotal($this->image));
|
||||
$this->log("Saved image to cache.");
|
||||
$this->log(" Cached image filesize: " . filesize($this->cacheFileName) . " bytes.");
|
||||
$this->log(" imageistruecolor() : " . (imageistruecolor($this->image) ? 'true' : 'false'));
|
||||
$this->log(" imagecolorstotal() : " . imagecolorstotal($this->image));
|
||||
$this->log(" Number of colors in image = " . $this->ColorsTotal($this->image));
|
||||
$index = imagecolortransparent($this->image);
|
||||
$this->log("Detected transparent color = " . ($index > 0 ? implode(", ", imagecolorsforindex($this->image, $index)) : "NONE") . " at index = $index");
|
||||
$this->log(" Detected transparent color = " . ($index > 0 ? implode(", ", imagecolorsforindex($this->image, $index)) : "NONE") . " at index = $index");
|
||||
}
|
||||
|
||||
return $this;
|
||||
@@ -2207,7 +2194,7 @@ class CImage
|
||||
return $this;
|
||||
}
|
||||
|
||||
$alias = $alias . "." . $this->extension;
|
||||
$alias = $alias . "." . $this->getTargetImageExtension();
|
||||
|
||||
if (is_readable($alias)) {
|
||||
unlink($alias);
|
||||
@@ -2310,23 +2297,22 @@ class CImage
|
||||
|
||||
clearstatcache();
|
||||
|
||||
$details['src'] = $this->imageSrc;
|
||||
$lastModified = filemtime($this->pathToImage);
|
||||
$details['src'] = $this->imageSrc;
|
||||
$lastModified = filemtime($this->pathToImage);
|
||||
$details['srcGmdate'] = gmdate("D, d M Y H:i:s", $lastModified);
|
||||
|
||||
$details['cache'] = basename($this->cacheFileName);
|
||||
$lastModified = filemtime($this->cacheFileName);
|
||||
$details['cache'] = basename($this->cacheFileName);
|
||||
$lastModified = filemtime($this->cacheFileName);
|
||||
$details['cacheGmdate'] = gmdate("D, d M Y H:i:s", $lastModified);
|
||||
|
||||
$this->loadImageDetails($file);
|
||||
|
||||
$details['filename'] = basename($file);
|
||||
$details['width'] = $this->width;
|
||||
$details['height'] = $this->height;
|
||||
$details['aspectRatio'] = round($this->width / $this->height, 3);
|
||||
$details['size'] = filesize($file);
|
||||
|
||||
$this->load($file);
|
||||
|
||||
$details['filename'] = basename($file);
|
||||
$details['mimeType'] = image_type_to_mime_type($this->fileType);
|
||||
$details['width'] = $this->width;
|
||||
$details['height'] = $this->height;
|
||||
$details['aspectRatio'] = round($this->width / $this->height, 3);
|
||||
$details['size'] = filesize($file);
|
||||
$details['colors'] = $this->colorsTotal($this->image);
|
||||
|
||||
$options = null;
|
||||
|
@@ -111,7 +111,7 @@
|
||||
</li>
|
||||
<li>
|
||||
<a href="../reports/markers.html">
|
||||
<i class="icon-list-alt"></i> Markers <span class="label label-info pull-right">165</span>
|
||||
<i class="icon-list-alt"></i> Markers <span class="label label-info pull-right">164</span>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
@@ -136,10 +136,10 @@
|
||||
<div class="accordion" style="margin-bottom: 0">
|
||||
<div class="accordion-group">
|
||||
<div class="accordion-heading">
|
||||
<a class="accordion-toggle " data-toggle="collapse" data-target="#namespace-976253765"></a>
|
||||
<a class="accordion-toggle " data-toggle="collapse" data-target="#namespace-609156684"></a>
|
||||
<a href="../namespaces/default.html" style="margin-left: 30px; padding-left: 0">\</a>
|
||||
</div>
|
||||
<div id="namespace-976253765" class="accordion-body collapse in">
|
||||
<div id="namespace-609156684" class="accordion-body collapse in">
|
||||
<div class="accordion-inner">
|
||||
|
||||
|
||||
@@ -245,7 +245,7 @@
|
||||
<section class="span10 offset1">
|
||||
<hr />
|
||||
Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor </a> and authored
|
||||
on March 4th, 2015 at 10:52.
|
||||
on March 6th, 2015 at 12:38.
|
||||
</section>
|
||||
</section>
|
||||
</section>
|
||||
|
@@ -111,7 +111,7 @@
|
||||
</li>
|
||||
<li>
|
||||
<a href="../reports/markers.html">
|
||||
<i class="icon-list-alt"></i> Markers <span class="label label-info pull-right">165</span>
|
||||
<i class="icon-list-alt"></i> Markers <span class="label label-info pull-right">164</span>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
@@ -136,10 +136,10 @@
|
||||
<div class="accordion" style="margin-bottom: 0">
|
||||
<div class="accordion-group">
|
||||
<div class="accordion-heading">
|
||||
<a class="accordion-toggle " data-toggle="collapse" data-target="#namespace-490266378"></a>
|
||||
<a class="accordion-toggle " data-toggle="collapse" data-target="#namespace-1345074256"></a>
|
||||
<a href="../namespaces/default.html" style="margin-left: 30px; padding-left: 0">\</a>
|
||||
</div>
|
||||
<div id="namespace-490266378" class="accordion-body collapse in">
|
||||
<div id="namespace-1345074256" class="accordion-body collapse in">
|
||||
<div class="accordion-inner">
|
||||
|
||||
|
||||
@@ -245,7 +245,7 @@
|
||||
<section class="span10 offset1">
|
||||
<hr />
|
||||
Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor </a> and authored
|
||||
on March 4th, 2015 at 10:52.
|
||||
on March 6th, 2015 at 12:38.
|
||||
</section>
|
||||
</section>
|
||||
</section>
|
||||
|
@@ -111,7 +111,7 @@
|
||||
</li>
|
||||
<li>
|
||||
<a href="../reports/markers.html">
|
||||
<i class="icon-list-alt"></i> Markers <span class="label label-info pull-right">165</span>
|
||||
<i class="icon-list-alt"></i> Markers <span class="label label-info pull-right">164</span>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
@@ -136,10 +136,10 @@
|
||||
<div class="accordion" style="margin-bottom: 0">
|
||||
<div class="accordion-group">
|
||||
<div class="accordion-heading">
|
||||
<a class="accordion-toggle " data-toggle="collapse" data-target="#namespace-960074806"></a>
|
||||
<a class="accordion-toggle " data-toggle="collapse" data-target="#namespace-716918064"></a>
|
||||
<a href="../namespaces/default.html" style="margin-left: 30px; padding-left: 0">\</a>
|
||||
</div>
|
||||
<div id="namespace-960074806" class="accordion-body collapse in">
|
||||
<div id="namespace-716918064" class="accordion-body collapse in">
|
||||
<div class="accordion-inner">
|
||||
|
||||
|
||||
@@ -238,7 +238,7 @@
|
||||
<section class="span10 offset1">
|
||||
<hr />
|
||||
Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor </a> and authored
|
||||
on March 4th, 2015 at 10:52.
|
||||
on March 6th, 2015 at 12:38.
|
||||
</section>
|
||||
</section>
|
||||
</section>
|
||||
|
@@ -111,7 +111,7 @@
|
||||
</li>
|
||||
<li>
|
||||
<a href="../reports/markers.html">
|
||||
<i class="icon-list-alt"></i> Markers <span class="label label-info pull-right">165</span>
|
||||
<i class="icon-list-alt"></i> Markers <span class="label label-info pull-right">164</span>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
@@ -136,10 +136,10 @@
|
||||
<div class="accordion" style="margin-bottom: 0">
|
||||
<div class="accordion-group">
|
||||
<div class="accordion-heading">
|
||||
<a class="accordion-toggle " data-toggle="collapse" data-target="#namespace-595581046"></a>
|
||||
<a class="accordion-toggle " data-toggle="collapse" data-target="#namespace-110318675"></a>
|
||||
<a href="../namespaces/default.html" style="margin-left: 30px; padding-left: 0">\</a>
|
||||
</div>
|
||||
<div id="namespace-595581046" class="accordion-body collapse in">
|
||||
<div id="namespace-110318675" class="accordion-body collapse in">
|
||||
<div class="accordion-inner">
|
||||
|
||||
|
||||
@@ -506,7 +506,7 @@
|
||||
<section class="span10 offset1">
|
||||
<hr />
|
||||
Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor </a> and authored
|
||||
on March 4th, 2015 at 10:52.
|
||||
on March 6th, 2015 at 12:38.
|
||||
</section>
|
||||
</section>
|
||||
</section>
|
||||
|
@@ -111,7 +111,7 @@
|
||||
</li>
|
||||
<li>
|
||||
<a href="../reports/markers.html">
|
||||
<i class="icon-list-alt"></i> Markers <span class="label label-info pull-right">165</span>
|
||||
<i class="icon-list-alt"></i> Markers <span class="label label-info pull-right">164</span>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
@@ -136,10 +136,10 @@
|
||||
<div class="accordion" style="margin-bottom: 0">
|
||||
<div class="accordion-group">
|
||||
<div class="accordion-heading">
|
||||
<a class="accordion-toggle " data-toggle="collapse" data-target="#namespace-508832227"></a>
|
||||
<a class="accordion-toggle " data-toggle="collapse" data-target="#namespace-805317831"></a>
|
||||
<a href="../namespaces/default.html" style="margin-left: 30px; padding-left: 0">\</a>
|
||||
</div>
|
||||
<div id="namespace-508832227" class="accordion-body collapse in">
|
||||
<div id="namespace-805317831" class="accordion-body collapse in">
|
||||
<div class="accordion-inner">
|
||||
|
||||
|
||||
@@ -240,7 +240,7 @@ config-file imgtest_config.php.</em></p>
|
||||
<section class="span10 offset1">
|
||||
<hr />
|
||||
Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor </a> and authored
|
||||
on March 4th, 2015 at 10:52.
|
||||
on March 6th, 2015 at 12:38.
|
||||
</section>
|
||||
</section>
|
||||
</section>
|
||||
|
@@ -88,7 +88,7 @@
|
||||
</li>
|
||||
<li>
|
||||
<a href="../reports/markers.html">
|
||||
<i class="icon-list-alt"></i> Markers <span class="label label-info pull-right">165</span>
|
||||
<i class="icon-list-alt"></i> Markers <span class="label label-info pull-right">164</span>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
@@ -152,7 +152,7 @@
|
||||
<section class="span10 offset1">
|
||||
<hr />
|
||||
Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor </a> and authored
|
||||
on March 4th, 2015 at 10:52.
|
||||
on March 6th, 2015 at 12:38.
|
||||
</section>
|
||||
</section>
|
||||
</section>
|
||||
|
@@ -63,7 +63,7 @@
|
||||
</li>
|
||||
<li>
|
||||
<a href="reports/markers.html">
|
||||
<i class="icon-list-alt"></i> Markers <span class="label label-info pull-right">165</span>
|
||||
<i class="icon-list-alt"></i> Markers <span class="label label-info pull-right">164</span>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
@@ -88,10 +88,10 @@
|
||||
<div class="accordion" style="margin-bottom: 0">
|
||||
<div class="accordion-group">
|
||||
<div class="accordion-heading">
|
||||
<a class="accordion-toggle " data-toggle="collapse" data-target="#namespace-261519606"></a>
|
||||
<a class="accordion-toggle " data-toggle="collapse" data-target="#namespace-11723610"></a>
|
||||
<a href="namespaces/default.html" style="margin-left: 30px; padding-left: 0">\</a>
|
||||
</div>
|
||||
<div id="namespace-261519606" class="accordion-body collapse in">
|
||||
<div id="namespace-11723610" class="accordion-body collapse in">
|
||||
<div class="accordion-inner">
|
||||
|
||||
|
||||
@@ -443,7 +443,7 @@
|
||||
<section class="span10 offset1">
|
||||
<hr />
|
||||
Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor </a> and authored
|
||||
on March 4th, 2015 at 10:52.
|
||||
on March 6th, 2015 at 12:38.
|
||||
</section>
|
||||
</section>
|
||||
</section>
|
||||
|
@@ -63,7 +63,7 @@
|
||||
</li>
|
||||
<li>
|
||||
<a href="../reports/markers.html">
|
||||
<i class="icon-list-alt"></i> Markers <span class="label label-info pull-right">165</span>
|
||||
<i class="icon-list-alt"></i> Markers <span class="label label-info pull-right">164</span>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
@@ -88,10 +88,10 @@
|
||||
<div class="accordion" style="margin-bottom: 0">
|
||||
<div class="accordion-group">
|
||||
<div class="accordion-heading">
|
||||
<a class="accordion-toggle " data-toggle="collapse" data-target="#namespace-539923952"></a>
|
||||
<a class="accordion-toggle " data-toggle="collapse" data-target="#namespace-1315371834"></a>
|
||||
<a href="../namespaces/default.html" style="margin-left: 30px; padding-left: 0">\</a>
|
||||
</div>
|
||||
<div id="namespace-539923952" class="accordion-body collapse in">
|
||||
<div id="namespace-1315371834" class="accordion-body collapse in">
|
||||
<div class="accordion-inner">
|
||||
|
||||
|
||||
@@ -443,7 +443,7 @@
|
||||
<section class="span10 offset1">
|
||||
<hr />
|
||||
Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor </a> and authored
|
||||
on March 4th, 2015 at 10:52.
|
||||
on March 6th, 2015 at 12:38.
|
||||
</section>
|
||||
</section>
|
||||
</section>
|
||||
|
Binary file not shown.
@@ -64,7 +64,7 @@
|
||||
</li>
|
||||
<li>
|
||||
<a href="../reports/markers.html">
|
||||
<i class="icon-list-alt"></i> Markers <span class="label label-info pull-right">165</span>
|
||||
<i class="icon-list-alt"></i> Markers <span class="label label-info pull-right">164</span>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
@@ -142,7 +142,7 @@
|
||||
<section class="span10 offset1">
|
||||
<hr />
|
||||
Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor </a> and authored
|
||||
on March 4th, 2015 at 10:52.
|
||||
on March 6th, 2015 at 12:38.
|
||||
</section>
|
||||
</section>
|
||||
</section>
|
||||
|
@@ -64,7 +64,7 @@
|
||||
</li>
|
||||
<li>
|
||||
<a href="../reports/markers.html">
|
||||
<i class="icon-list-alt"></i> Markers <span class="label label-info pull-right">165</span>
|
||||
<i class="icon-list-alt"></i> Markers <span class="label label-info pull-right">164</span>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
@@ -89,11 +89,11 @@
|
||||
|
||||
<ul class="side-nav nav nav-list">
|
||||
<li class="nav-header">Navigation</li>
|
||||
<li><a href="#CRemoteImage.php"><i class="icon-file"></i> CRemoteImage.php</a></li>
|
||||
<li><a href="#CRemoteImage.php"><i class="icon-file"></i> CRemoteImage.php</a></li>
|
||||
<li><a href="#CImage.php"><i class="icon-file"></i> CImage.php</a></li>
|
||||
<li><a href="#CHttpGet.php"><i class="icon-file"></i> CHttpGet.php</a></li>
|
||||
<li><a href="#CHttpGet.php"><i class="icon-file"></i> CHttpGet.php</a></li>
|
||||
<li><a href="#CWhitelist.php"><i class="icon-file"></i> CWhitelist.php</a></li>
|
||||
</ul>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="span10 offset2">
|
||||
@@ -103,6 +103,8 @@
|
||||
</ul>
|
||||
|
||||
|
||||
<div class="package-contents">
|
||||
</div>
|
||||
<div class="package-contents">
|
||||
<a name="CRemoteImage.php" id="CRemoteImage.php"></a>
|
||||
<h3>
|
||||
@@ -158,12 +160,12 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<td>error</td>
|
||||
<td>1041</td>
|
||||
<td>1042</td>
|
||||
<td>Argument $saveAs is missing from the Docblock of setSaveAsExtension()</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>error</td>
|
||||
<td>1729</td>
|
||||
<td>1702</td>
|
||||
<td>Argument $bgColor is missing from the Docblock of rotate()</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@@ -260,6 +262,8 @@
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="package-contents">
|
||||
</div>
|
||||
<div class="package-contents">
|
||||
<a name="CHttpGet.php" id="CHttpGet.php"></a>
|
||||
<h3>
|
||||
@@ -324,10 +328,6 @@
|
||||
</div>
|
||||
<div class="package-contents">
|
||||
</div>
|
||||
<div class="package-contents">
|
||||
</div>
|
||||
<div class="package-contents">
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
@@ -367,7 +367,7 @@
|
||||
<section class="span10 offset1">
|
||||
<hr />
|
||||
Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor </a> and authored
|
||||
on March 4th, 2015 at 10:52.
|
||||
on March 6th, 2015 at 12:38.
|
||||
</section>
|
||||
</section>
|
||||
</section>
|
||||
|
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user