Пример #1
0
} 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>';
echo '<tr><th>GD extension "EXIF"</th><th colspan="2" bgcolor="';
if (extension_loaded('exif')) {
    echo 'lime';
} elseif (@$ServerInfo['gd_string']) {
    echo 'orange';
                    }
                }
            } 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>';
}
echo '<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>';
if ($ServerInfo['im_version']) {
    echo '<td colspan="2"><div style="width: 100%; height: 200px; overflow: auto; font-family: monospace; white-space: pre; background-color: #FFFFFF;">' . htmlentities($phpThumb->ImageMagickFormatsList()) . '</div></td>';
} else {
    echo '<th colspan="2" style="background-color: orange;">ImageMagick not found</th>';
}
echo '<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('JPEG Support', 'JPG Support', 'PNG Support');
// older versions would report "JPG Support", newer versions report "JPEG Support"
$GDfeatures['orange'] = array('GIF Read Support', 'GIF Create Support', 'FreeType Support');
foreach ($GDfeatures as $missingcolor => $features) {
    foreach ($features as $dummy => $feature) {
        if (isset($gd_info[$feature])) {
            echo '<div style="background-color: ' . ($gd_info[$feature] ? 'lime' : $missingcolor) . ';">' . htmlentities($feature) . '</div>';
        }
    }
}