本文整理匯總了PHP中phpThumb::ImageMagickVersion方法的典型用法代碼示例。如果您正苦於以下問題:PHP phpThumb::ImageMagickVersion方法的具體用法?PHP phpThumb::ImageMagickVersion怎麽用?PHP phpThumb::ImageMagickVersion使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類phpThumb
的用法示例。
在下文中一共展示了phpThumb::ImageMagickVersion方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: die
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'];
?>
示例2: validate
/**
* 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);
}