@@ -18,6 +18,9 @@ discard block |
||
18 | 18 | public $phpThumbObject = null; |
19 | 19 | |
20 | 20 | |
21 | + /** |
|
22 | + * @param string $message |
|
23 | + */ |
|
21 | 24 | public function DebugMessage($message, $file='', $line='') { |
22 | 25 | if (is_object($this->phpThumbObject)) { |
23 | 26 | return $this->phpThumbObject->DebugMessage($message, $file, $line); |
@@ -752,6 +755,9 @@ discard block |
||
752 | 755 | } |
753 | 756 | |
754 | 757 | |
758 | + /** |
|
759 | + * @param phpthumb $phpThumbObject |
|
760 | + */ |
|
755 | 761 | public static function ImprovedImageRotate(&$gdimg_source, $rotate_angle=0, $config_background_hexcolor='FFFFFF', $bg=null, &$phpThumbObject) { |
756 | 762 | while ($rotate_angle < 0) { |
757 | 763 | $rotate_angle += 360; |
@@ -1049,6 +1055,10 @@ discard block |
||
1049 | 1055 | } |
1050 | 1056 | |
1051 | 1057 | |
1058 | + /** |
|
1059 | + * @param boolean $dither |
|
1060 | + * @param integer $ncolors |
|
1061 | + */ |
|
1052 | 1062 | public function ImageTrueColorToPalette2(&$image, $dither, $ncolors) { |
1053 | 1063 | // http://www.php.net/manual/en/function.imagetruecolortopalette.php |
1054 | 1064 | // zmorris at zsculpt dot com (17-Aug-2004 06:58) |
@@ -23,6 +23,9 @@ discard block |
||
23 | 23 | } |
24 | 24 | |
25 | 25 | |
26 | + /** |
|
27 | + * @param string $functionname |
|
28 | + */ |
|
26 | 29 | public static function builtin_function_exists($functionname) { |
27 | 30 | if (function_exists('get_defined_functions')) { |
28 | 31 | static $get_defined_functions = array(); |
@@ -35,6 +38,10 @@ discard block |
||
35 | 38 | } |
36 | 39 | |
37 | 40 | |
41 | + /** |
|
42 | + * @param string $version1 |
|
43 | + * @param string $version2 |
|
44 | + */ |
|
38 | 45 | public static function version_compare_replacement_sub($version1, $version2, $operator='') { |
39 | 46 | // If you specify the third optional operator argument, you can test for a particular relationship. |
40 | 47 | // The possible operators are: <, lt, <=, le, >, gt, >=, ge, ==, =, eq, !=, <>, ne respectively. |
@@ -95,6 +102,9 @@ discard block |
||
95 | 102 | } |
96 | 103 | |
97 | 104 | |
105 | + /** |
|
106 | + * @param string $version2 |
|
107 | + */ |
|
98 | 108 | public static function version_compare_replacement($version1, $version2, $operator='') { |
99 | 109 | if (function_exists('version_compare')) { |
100 | 110 | // built into PHP v4.1.0+ |
@@ -212,6 +222,9 @@ discard block |
||
212 | 222 | return array($newwidth, $newheight); |
213 | 223 | } |
214 | 224 | |
225 | + /** |
|
226 | + * @param string $string |
|
227 | + */ |
|
215 | 228 | public static function HexCharDisplay($string) { |
216 | 229 | $len = strlen($string); |
217 | 230 | $output = ''; |
@@ -292,6 +305,10 @@ discard block |
||
292 | 305 | } |
293 | 306 | |
294 | 307 | |
308 | + /** |
|
309 | + * @param integer $width |
|
310 | + * @param integer $height |
|
311 | + */ |
|
295 | 312 | public static function ScaleToFitInBox($width, $height, $maxwidth=null, $maxheight=null, $allow_enlarge=true, $allow_reduce=true) { |
296 | 313 | $maxwidth = (null === $maxwidth ? $width : $maxwidth); |
297 | 314 | $maxheight = (null === $maxheight ? $height : $maxheight); |
@@ -380,6 +397,12 @@ discard block |
||
380 | 397 | } |
381 | 398 | |
382 | 399 | |
400 | + /** |
|
401 | + * @param integer $src_x |
|
402 | + * @param integer $src_y |
|
403 | + * @param integer $src_w |
|
404 | + * @param integer $src_h |
|
405 | + */ |
|
383 | 406 | public static function ImageCopyRespectAlpha(&$dst_im, &$src_im, $dst_x, $dst_y, $src_x, $src_y, $src_w, $src_h, $opacity_pct=100) { |
384 | 407 | $opacipct = $opacity_pct / 100; |
385 | 408 | for ($x = $src_x; $x < $src_w; $x++) { |
@@ -404,6 +427,10 @@ discard block |
||
404 | 427 | } |
405 | 428 | |
406 | 429 | |
430 | + /** |
|
431 | + * @param integer $old_width |
|
432 | + * @param integer $old_height |
|
433 | + */ |
|
407 | 434 | public static function ProportionalResize($old_width, $old_height, $new_width=false, $new_height=false) { |
408 | 435 | $old_aspect_ratio = $old_width / $old_height; |
409 | 436 | if (($new_width === false) && ($new_height === false)) { |
@@ -430,6 +457,9 @@ discard block |
||
430 | 457 | } |
431 | 458 | |
432 | 459 | |
460 | + /** |
|
461 | + * @param string $function |
|
462 | + */ |
|
433 | 463 | public static function FunctionIsDisabled($function) { |
434 | 464 | static $DisabledFunctions = null; |
435 | 465 | if (null === $DisabledFunctions) { |
@@ -450,6 +480,11 @@ discard block |
||
450 | 480 | } |
451 | 481 | |
452 | 482 | |
483 | + /** |
|
484 | + * @param string $command |
|
485 | + * |
|
486 | + * @return string |
|
487 | + */ |
|
453 | 488 | public static function SafeExec($command) { |
454 | 489 | static $AllowedExecFunctions = array(); |
455 | 490 | if (empty($AllowedExecFunctions)) { |
@@ -626,6 +661,10 @@ discard block |
||
626 | 661 | return false; |
627 | 662 | } |
628 | 663 | |
664 | + /** |
|
665 | + * @param string $needle |
|
666 | + * @param string[] $haystack |
|
667 | + */ |
|
629 | 668 | public static function CaseInsensitiveInArray($needle, $haystack) { |
630 | 669 | $needle = strtolower($needle); |
631 | 670 | foreach ($haystack as $key => $value) { |
@@ -638,6 +677,9 @@ discard block |
||
638 | 677 | return false; |
639 | 678 | } |
640 | 679 | |
680 | + /** |
|
681 | + * @param string $file |
|
682 | + */ |
|
641 | 683 | public static function URLreadFsock($host, $file, &$errstr, $successonly=true, $port=80, $timeout=10) { |
642 | 684 | if (!function_exists('fsockopen') || self::FunctionIsDisabled('fsockopen')) { |
643 | 685 | $errstr = 'fsockopen() unavailable'; |
@@ -64,6 +64,9 @@ discard block |
||
64 | 64 | |
65 | 65 | /////////////////////////////////////////////////////////////////////////////////////////////////// |
66 | 66 | |
67 | +/** |
|
68 | + * @param string $lpszFileName |
|
69 | + */ |
|
67 | 70 | function gif_outputAsBmp($gif, $lpszFileName, $bgColor = -1) |
68 | 71 | { |
69 | 72 | if (!isset($gif) || (@get_class($gif) <> 'cgif') || !$gif->loaded() || ($lpszFileName == '')) { |
@@ -186,6 +189,10 @@ discard block |
||
186 | 189 | |
187 | 190 | /////////////////////////////////////////////////////////////////////////// |
188 | 191 | |
192 | + /** |
|
193 | + * @param string $data |
|
194 | + * @param integer $datLen |
|
195 | + */ |
|
189 | 196 | public function deCompress($data, &$datLen) |
190 | 197 | { |
191 | 198 | $stLen = strlen($data); |
@@ -210,6 +217,11 @@ discard block |
||
210 | 217 | |
211 | 218 | /////////////////////////////////////////////////////////////////////////// |
212 | 219 | |
220 | + /** |
|
221 | + * @param boolean $bInit |
|
222 | + * |
|
223 | + * @return integer |
|
224 | + */ |
|
213 | 225 | public function LZWCommand(&$data, $bInit) |
214 | 226 | { |
215 | 227 | if ($bInit) { |
@@ -392,6 +404,10 @@ discard block |
||
392 | 404 | |
393 | 405 | /////////////////////////////////////////////////////////////////////////// |
394 | 406 | |
407 | + /** |
|
408 | + * @param string $lpData |
|
409 | + * @param integer $num |
|
410 | + */ |
|
395 | 411 | public function load($lpData, $num) |
396 | 412 | { |
397 | 413 | $this->m_nColors = 0; |
@@ -504,6 +520,9 @@ discard block |
||
504 | 520 | |
505 | 521 | /////////////////////////////////////////////////////////////////////////// |
506 | 522 | |
523 | + /** |
|
524 | + * @param integer $hdrLen |
|
525 | + */ |
|
507 | 526 | public function load($lpData, &$hdrLen) |
508 | 527 | { |
509 | 528 | $hdrLen = 0; |
@@ -541,6 +560,9 @@ discard block |
||
541 | 560 | |
542 | 561 | /////////////////////////////////////////////////////////////////////////// |
543 | 562 | |
563 | + /** |
|
564 | + * @param string $str |
|
565 | + */ |
|
544 | 566 | public function w2i($str) |
545 | 567 | { |
546 | 568 | return ord($str[ 0 ]) + (ord($str[ 1 ]) << 8); |
@@ -579,6 +601,10 @@ discard block |
||
579 | 601 | |
580 | 602 | /////////////////////////////////////////////////////////////////////////// |
581 | 603 | |
604 | + /** |
|
605 | + * @param string $lpData |
|
606 | + * @param integer $hdrLen |
|
607 | + */ |
|
582 | 608 | public function load($lpData, &$hdrLen) |
583 | 609 | { |
584 | 610 | $hdrLen = 0; |
@@ -612,6 +638,9 @@ discard block |
||
612 | 638 | |
613 | 639 | /////////////////////////////////////////////////////////////////////////// |
614 | 640 | |
641 | + /** |
|
642 | + * @param string $str |
|
643 | + */ |
|
615 | 644 | public function w2i($str) |
616 | 645 | { |
617 | 646 | return ord($str[ 0 ]) + (ord($str[ 1 ]) << 8); |
@@ -649,6 +678,10 @@ discard block |
||
649 | 678 | |
650 | 679 | /////////////////////////////////////////////////////////////////////////// |
651 | 680 | |
681 | + /** |
|
682 | + * @param string $data |
|
683 | + * @param integer $datLen |
|
684 | + */ |
|
652 | 685 | public function load($data, &$datLen) |
653 | 686 | { |
654 | 687 | $datLen = 0; |
@@ -696,6 +729,10 @@ discard block |
||
696 | 729 | |
697 | 730 | /////////////////////////////////////////////////////////////////////////// |
698 | 731 | |
732 | + /** |
|
733 | + * @param string $data |
|
734 | + * @param integer $extLen |
|
735 | + */ |
|
699 | 736 | public function skipExt(&$data, &$extLen) |
700 | 737 | { |
701 | 738 | $extLen = 0; |
@@ -741,6 +778,9 @@ discard block |
||
741 | 778 | |
742 | 779 | /////////////////////////////////////////////////////////////////////////// |
743 | 780 | |
781 | + /** |
|
782 | + * @param string $str |
|
783 | + */ |
|
744 | 784 | public function w2i($str) |
745 | 785 | { |
746 | 786 | return ord($str[ 0 ]) + (ord($str[ 1 ]) << 8); |
@@ -814,6 +854,9 @@ discard block |
||
814 | 854 | |
815 | 855 | /////////////////////////////////////////////////////////////////////////// |
816 | 856 | |
857 | + /** |
|
858 | + * @param integer $iIndex |
|
859 | + */ |
|
817 | 860 | public function loadFile($lpszFileName, $iIndex) |
818 | 861 | { |
819 | 862 | if ($iIndex < 0) { |
@@ -967,6 +1010,9 @@ discard block |
||
967 | 1010 | |
968 | 1011 | /////////////////////////////////////////////////////////////////////////// |
969 | 1012 | |
1013 | + /** |
|
1014 | + * @param integer $bgColor |
|
1015 | + */ |
|
970 | 1016 | public function getPng($bgColor) |
971 | 1017 | { |
972 | 1018 | $out = ''; |