// // available at http://phpthumb.sourceforge.net /// ////////////////////////////////////////////////////////////// /// // // phpThumb.demo.check.php // // James Heinrich // // // // Configuration analyzer for phpThumb settings and server // // settings that may affect phpThumb performance // // Live demo is at http://phpthumb.sourceforge.net/demo/ // // // ////////////////////////////////////////////////////////////// $ServerInfo['gd_string'] = 'unknown'; $ServerInfo['gd_numeric'] = 0; ob_start(); if (!@include_once('../phpthumb.functions.php')) { ob_end_flush(); 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['gd_string'] = phpthumb_functions::gd_version(true); $ServerInfo['gd_numeric'] = phpthumb_functions::gd_version(false); $ServerInfo['im_version'] = $phpThumb->ImageMagickVersion(); $gd_info = gd_info(); ?> phpThumb configuration analyzer This demo analyzes your settings (phpThumb.config.php and server/PHP) for phpThumb().

<-- bad to good -->
                                       
phpthumb_functions::SafeURLread('http://phpthumb.sourceforge.net/?latestversion=1', $dummy), 'this' => $phpThumb->phpthumb_version, ); foreach ($versions['raw'] as $key => $value) { eregi('^([0-9\.]+)\-?(([0-9]{4})([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2}))?', $value, $matches); @list($huge, $major, $minor) = @explode('.', @$matches[1]); @list($year, $month, $day, $hour, $min) = @$matches[3]; $versions['base'][$key] = $matches[1]; $versions['huge'][$key] = $huge; $versions['major'][$key] = $major; $versions['minor'][$key] = $minor; $versions['stamp'][$key] = $matches[2]; $versions['year'][$key] = $year; $versions['month'][$key] = $month; $versions['day'][$key] = $day; $versions['hour'][$key] = $hour; $versions['min'][$key] = $min; $versions['date'][$key] = @mktime($hour, $min, 0, $month, $day, $year); } $downloadlatest = 'Download the latest version from http://phpthumb.sourceforge.net'; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; ?>
Latest phpThumb version:'.$versions['raw']['latest'].''.$downloadlatest.'
This phpThumb version:info@silisoftware.com'; } elseif (($versions['base']['latest'] == $versions['base']['this']) && ($versions['stamp']['this'] > $versions['stamp']['latest'])) { // new than latest, must be beta version echo 'lightblue'; $message = 'You must be using a pre-release beta version. Please report bugs to info@silisoftware.com'; } elseif ($versions['base']['latest'] == $versions['base']['this']) { // latest version echo 'lime'; $message = 'You are using the latest released version.'; } elseif ($versions['huge']['latest'].$versions['major']['latest'] == $versions['huge']['this'].$versions['major']['this']) { echo 'olive'; $message = 'One (or more) minor version(s) have been released since this version.
'.$downloadlatest; } elseif (floatval($versions['huge']['latest'].str_pad($versions['major']['latest'], 2, '0', STR_PAD_LEFT)) < floatval($versions['huge']['this'].str_pad($t_major, 2, '0', STR_PAD_LEFT))) { echo 'yellow'; $message = 'One (or more) major version(s) have been released since this version, you really should upgrade.
'.$downloadlatest; } else { echo 'orange'; $message = 'Fundamental changes have been made since this version.
'.$downloadlatest; } echo '">'.$phpThumb->phpthumb_version; echo '
'.$message.'.
PHP version:'.phpversion(); echo 'PHP5 is ideal (support for numerous built-in filters which are much faster than my code).
PHP v4.3.2+ supports ImageSaveAlpha which is required for proper PNG/ICO output.
ImageRotate requires PHP v4.3.0+ (but buggy before v4.3.3).
EXIF thumbnail extraction requires PHP v4.2.0+.
Most things will work back to PHP v4.1.0, and mostly (perhaps buggy) back to v4.0.6, but no guarantees for any version older than that.
GD version:'.@$ServerInfo['gd_string']; echo 'GD2-bundled version is ideal.
GD2 (non-bundled) is second choice, but there are a number of bugs in the non-bundled version.
GD1 will also (mostly) work, at much-reduced image quality and several features disabled. phpThumb can perform basic resizing with ImageMagick only, even if GD is not available.
ImageMagick version:'.($ServerInfo['im_version'] ? $ServerInfo['im_version'] : 'n/a'); echo 'ImageMagick is faster than GD, can process larger images without PHP memory_limit issues, can resize animated GIFs. phpThumb can perform basic resizing with ImageMagick only, even if GD is not available.
GD features:'; $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 '
'.htmlentities($feature).'
'; } } echo '
PNG support is required for watermarks, overlays, calls to ImageMagick and other internal operations.
JPG support is obviously quite useful, but ImageMagick can substitute
GIF read support can be bypassed with ImageMagick and/or internal GIF routines.
GIF create support can be bypassed with ImageMagick (if no filters are applied)
FreeType support is needed for TTF overlays.
GD extension "EXIF"'.(extension_loaded('exif') ? 'TRUE' : 'FALSE'); echo 'EXIF extension required for auto-rotate images. Also required to extract EXIF thumbnail to use as source if source image is too large for PHP memory_limit and ImageMagick is unavailable.
magic_quotes_runtime:'.$phpThumb->phpThumbDebugVarDump((bool) @get_magic_quotes_runtime()); echo 'This setting is evil. Turn it off.
magic_quotes_gpc:'.$phpThumb->phpThumbDebugVarDump((bool) @get_magic_quotes_gpc()); echo 'This setting is bad. Turn it off, if possible. phpThumb will attempt to work around it if it is enabled
safe_mode:'.$phpThumb->phpThumbDebugVarDump((bool) @ini_get('safe_mode')); echo 'Best if off. Calls to ImageMagick will be disabled if on (limiting max image resolution, no animated GIF resize).
allow_url_fopen:'.$phpThumb->phpThumbDebugVarDump((bool) @ini_get('allow_url_fopen')); echo 'Best if on. HTTP source images will be unavailable if disabled and CURL is unavailable.
curl_version:'.(function_exists('curl_version') ? curl_version() : 'n/a') ; echo 'Best if available. HTTP source images will be unavailable if CURL unavailable and allow_url_fopen is also disabled.
disable_functions:'.eregi_replace('(shell_exec|system|passthru|exec)(,|$)', '\\1(\\2)', $disable_functions); echo 'Best if nothing disabled. Calls to ImageMagick will be prevented if exec+system+shell_exec+passthru are disabled.
memory_limit:'.($memory_limit ? $memory_limit : 'unlimited'); echo 'The higher the better. Divide by 5 to get maximum megapixels of source image that can be thumbnailed (without ImageMagick).'.($memory_limit ? ' Your setting ('.$memory_limit.') allows images up to approximately '.number_format($memory_limit / 5, 1).' megapixels' : '').'