Пример #1
0
    die('failed to include_once("../phpthumb.functions.php")');
}
if (!(include_once '../phpthumb.class.php')) {
    //ob_end_flush();
    die('failed to include_once("../phpthumb.class.php")');
}
//ob_end_clean();
$phpThumb = new phpThumb();
if (include_once '../phpThumb.config.php') {
    foreach ($PHPTHUMB_CONFIG as $key => $value) {
        $keyname = 'config_' . $key;
        $phpThumb->setParameter($keyname, $value);
    }
}
$ServerInfo['phpthumb_version'] = $phpThumb->phpthumb_version;
$ServerInfo['im_version'] = $phpThumb->ImageMagickVersion();
$ServerInfo['gd_string'] = phpthumb_functions::gd_version(true);
$ServerInfo['gd_numeric'] = phpthumb_functions::gd_version(false);
unset($phpThumb);
?>

<html>
<head>
	<title>Demo of phpThumb() - thumbnails created by PHP using GD and/or ImageMagick</title>
	<link rel="stylesheet" type="text/css" href="/style.css" title="style sheet">
</head>
<body bgcolor="#C5C5C5">

This is a demo of <a href="http://phpthumb.sourceforge.net"><b>phpThumb()</b></a> (current version: v<?php 
echo @$ServerInfo['phpthumb_version'];
?>
 /**
  * Concrete implementation of the validate() method. This methods determines 
  * whether input validation passes or not.
  * @param object ReusableOption &$target 	The option to validate.
  * @return String 	The error message created by this test.
  * @access public
  */
 function validate(&$target)
 {
     $errMsg = '';
     require_once PHOTOQ_PATH . 'lib/phpThumb_1.7.9/phpthumb.class.php';
     // create phpThumb object
     $phpThumb = new phpThumb();
     $phpThumb->config_imagemagick_path = $target->getValue() ? $target->getValue() : null;
     //under windows the version check doesn't seem to work so we also check for availability of resize
     if (!$phpThumb->ImageMagickVersion() && !$phpThumb->ImageMagickSwitchAvailable('resize')) {
         $errMsg = __("Note: ImageMagick does not seem to be installed at the location you specified. ImageMagick is optional but might be needed to process bigger photos, plus PhotoQ might run faster if you configure ImageMagick correctly. If you don't care about ImageMagick and are happy with using the GD library you can safely ignore this message.", 'PhotoQ');
     }
     return $this->formatErrMsg($errMsg);
 }