當前位置: 首頁>>代碼示例>>PHP>>正文


PHP phpThumb::ImageMagickSwitchAvailable方法代碼示例

本文整理匯總了PHP中phpThumb::ImageMagickSwitchAvailable方法的典型用法代碼示例。如果您正苦於以下問題:PHP phpThumb::ImageMagickSwitchAvailable方法的具體用法?PHP phpThumb::ImageMagickSwitchAvailable怎麽用?PHP phpThumb::ImageMagickSwitchAvailable使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在phpThumb的用法示例。


在下文中一共展示了phpThumb::ImageMagickSwitchAvailable方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: htmlentities

echo '<div style="color: blue; font-family: monospace;">' . htmlentities($phpThumb->ImageMagickCommandlineBase()) . '</div>';
echo $ServerInfo['im_version'] ? $ServerInfo['im_version'] : 'n/a';
echo $IMreleaseDate ? '<br><br>This version of ImageMagick is ' . NiceTimeFormatting($IMversionAge) . ' old<br>(see <a href="http://www.imagemagick.org/">www.imagemagick.org</a> for new versions)' : '';
echo '</th><td>ImageMagick is faster than GD, can process larger images without PHP memory_limit issues, can resize animated GIFs. phpThumb can perform most operations with ImageMagick only, even if GD is not available.</td></tr>';
echo '<tr><th>ImageMagick features:</th>';
if ($ServerInfo['im_version']) {
    $GDfeatures['red'] = array('help', 'thumbnail', 'resize', 'crop', 'repage', 'coalesce', 'gravity', 'background', 'interlace', 'flatten', 'border', 'bordercolor', 'dither', 'quality');
    $GDfeatures['orange'] = array('version', 'blur', 'colorize', 'colors', 'colorspace', 'contrast', 'contrast-stretch', 'edge', 'emboss', 'fill', 'flip', 'flop', 'gamma', array('gaussian', 'gaussian-blur'), 'level', 'modulate', 'monochrome', 'negate', 'normalize', 'rotate', 'sepia-tone', 'threshold', 'unsharp');
    echo '<th colspan="2">|';
    foreach ($GDfeatures as $missingcolor => $features) {
        foreach ($features as $dummy => $feature) {
            $foundOneThatWorks = false;
            if (is_array($feature)) {
                // sometimes feature names change, e.g. "gaussian" -> "gaussian-blur". They won't both exist in the same version of ImageMagick, but as long as one of them does then the feature will work
                foreach ($feature as $alternate_feature_name) {
                    if ($phpThumb->ImageMagickSwitchAvailable($alternate_feature_name)) {
                        $foundOneThatWorks = true;
                        $feature = $alternate_feature_name;
                        break;
                    }
                }
            } else {
                $foundOneThatWorks = $phpThumb->ImageMagickSwitchAvailable($feature);
            }
            echo '| <span style="background-color: ' . ($foundOneThatWorks ? 'lime' : $missingcolor) . ';">' . htmlentities($feature) . '</span> |';
        }
    }
    echo '|</th>';
} else {
    echo '<th colspan="2" style="background-color: orange;">ImageMagick not found</th>';
}
開發者ID:madberry,項目名稱:WhiteLabelTransfer,代碼行數:31,代碼來源:phpThumb.demo.check.php

示例2: htmlentities

    } else {
        echo 'olive';
    }
} elseif (@$ServerInfo['gd_string']) {
    echo 'orange';
} else {
    echo 'red';
}
echo '">"' . $phpThumb->ImageMagickCommandlineBase() . '"<br>' . ($ServerInfo['im_version'] ? $ServerInfo['im_version'] : 'n/a') . (@$IMversionAge ? '<br><br>This version of ImageMagick is ' . ($IMversionAge < 180 ? number_format($IMversionAge / 30, 2) . ' months' : number_format($IMversionAge / 365, 2) . ' years') . ' old<br>(see www.imagemagick.org for new versions)' : '');
echo '</th><td>ImageMagick is faster than GD, can process larger images without PHP memory_limit issues, can resize animated GIFs. phpThumb can perform most operations with ImageMagick only, even if GD is not available.</td></tr>';
echo '<tr><th>ImageMagick features:</th><th colspan="2">|';
$GDfeatures['red'] = array('help', 'thumbnail', 'resize', 'crop', 'repage', 'coalesce', 'gravity', 'background', 'interlace', 'flatten', 'border', 'bordercolor', 'dither', 'quality');
$GDfeatures['orange'] = array('version', 'blur', 'colorize', 'colors', 'colorspace', 'contrast', 'contrast-stretch', 'edge', 'emboss', 'fill', 'flip', 'flop', 'gamma', 'gaussian', 'level', 'modulate', 'monochrome', 'negate', 'normalize', 'rotate', 'sepia-tone', 'threshold', 'unsharp');
foreach ($GDfeatures as $missingcolor => $features) {
    foreach ($features as $dummy => $feature) {
        echo '| <span style="background-color: ' . ($phpThumb->ImageMagickSwitchAvailable($feature) ? 'lime' : $missingcolor) . ';">' . htmlentities($feature) . '</span> |';
    }
}
echo '|</th><td>All of these parameters may be called by phpThumb, depending on parameters used.  Green means the feature is available; red means a critical feature is missing; orange means an optional filter/feature is missing.</td></tr>';
echo '<tr><th>ImageMagick formats:</th><th colspan="2"><textarea rows="10" cols="50" wrap="off">';
echo htmlentities($phpThumb->ImageMagickFormatsList());
echo '</textarea></th><td>ImageMagick can only read/write formats as listed here. You may need to recompile ImageMagick if you need to use a format not listed</td></tr>';
echo '<tr><th>GD features:</th><th colspan="2">';
$GDfeatures['red'] = array('JPG Support', 'PNG Support');
$GDfeatures['orange'] = array('GIF Read Support', 'GIF Create Support', 'FreeType Support');
foreach ($GDfeatures as $missingcolor => $features) {
    foreach ($features as $dummy => $feature) {
        echo '<div style="background-color: ' . ($gd_info[$feature] ? 'lime' : $missingcolor) . ';">' . htmlentities($feature) . '</div>';
    }
}
echo '</th><td>PNG support is required for watermarks, overlays, calls to ImageMagick and other internal operations.<br>JPG support is obviously quite useful, but ImageMagick can substitute<br>GIF read support can be bypassed with ImageMagick and/or internal GIF routines.<br>GIF create support can be bypassed with ImageMagick (if no filters are applied)<br>FreeType support is needed for TTF overlays.</td></tr>';
開發者ID:jtresca,項目名稱:nysurveyor,代碼行數:31,代碼來源:phpThumb.demo.check.php

示例3: 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);
 }
開發者ID:alx,項目名稱:amandineleconte.fr,代碼行數:20,代碼來源:PhotoQOptionController.php


注:本文中的phpThumb::ImageMagickSwitchAvailable方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。