当前位置: 首页>>代码示例>>PHP>>正文


PHP phpthumb_functions::gd_info方法代码示例

本文整理汇总了PHP中phpthumb_functions::gd_info方法的典型用法代码示例。如果您正苦于以下问题:PHP phpthumb_functions::gd_info方法的具体用法?PHP phpthumb_functions::gd_info怎么用?PHP phpthumb_functions::gd_info使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在phpthumb_functions的用法示例。


在下文中一共展示了phpthumb_functions::gd_info方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: phpThumbDebug

 function phpThumbDebug()
 {
     if ($this->config_disable_debug) {
         return $this->ErrorImage('phpThumbDebug disabled');
     }
     $FunctionsExistance = array('exif_thumbnail', 'gd_info', 'image_type_to_mime_type', 'ImageCopyResampled', 'ImageCopyResized', 'ImageCreate', 'ImageCreateFromString', 'ImageCreateTrueColor', 'ImageIsTrueColor', 'ImageRotate', 'ImageTypes', 'version_compare', 'ImageCreateFromGIF', 'ImageCreateFromJPEG', 'ImageCreateFromPNG', 'ImageCreateFromWBMP', 'ImageCreateFromXBM', 'ImageCreateFromXPM', 'ImageCreateFromString', 'ImageCreateFromGD', 'ImageCreateFromGD2', 'ImageCreateFromGD2Part', 'ImageJPEG', 'ImageGIF', 'ImagePNG', 'ImageWBMP');
     $ParameterNames = array('src', 'new', 'w', 'h', 'f', 'q', 'sx', 'sy', 'sw', 'sh', 'far', 'bg', 'bc', 'file', 'goto', 'err', 'xto', 'ra', 'ar', 'aoe', 'iar', 'maxb');
     $OtherVariableNames = array('phpThumbDebug', 'thumbnailQuality', 'thumbnailFormat', 'gdimg_output', 'gdimg_source', 'sourceFilename', 'source_width', 'source_height', 'thumbnailCropX', 'thumbnailCropY', 'thumbnailCropW', 'thumbnailCropH', 'exif_thumbnail_width', 'exif_thumbnail_height', 'exif_thumbnail_type', 'thumbnail_width', 'thumbnail_height', 'thumbnail_image_width', 'thumbnail_image_height');
     $DebugOutput = array();
     $DebugOutput[] = 'phpThumb() version          = ' . $this->phpthumb_version;
     $DebugOutput[] = 'phpversion()                = ' . @phpversion();
     $DebugOutput[] = 'PHP_OS                      = ' . PHP_OS;
     $DebugOutput[] = '__FILE__                    = ' . __FILE__;
     $DebugOutput[] = 'realpath(.)                 = ' . @realpath('.');
     $DebugOutput[] = '$_SERVER[PHP_SELF]          = ' . @$_SERVER['PHP_SELF'];
     $DebugOutput[] = '$_SERVER[HTTP_REFERER]      = ' . @$_SERVER['HTTP_REFERER'];
     $DebugOutput[] = '$_SERVER[QUERY_STRING]      = ' . @$_SERVER['QUERY_STRING'];
     $DebugOutput[] = '$_SERVER[PATH_INFO]         = ' . @$_SERVER['PATH_INFO'];
     $DebugOutput[] = '$_SERVER[DOCUMENT_ROOT]     = ' . @$_SERVER['DOCUMENT_ROOT'];
     $DebugOutput[] = 'getenv(DOCUMENT_ROOT)       = ' . @getenv('DOCUMENT_ROOT');
     $DebugOutput[] = '';
     $DebugOutput[] = 'get_magic_quotes_gpc()      = ' . $this->phpThumbDebugVarDump(@get_magic_quotes_gpc());
     $DebugOutput[] = 'get_magic_quotes_runtime()  = ' . $this->phpThumbDebugVarDump(@get_magic_quotes_runtime());
     $DebugOutput[] = 'error_reporting()           = ' . $this->phpThumbDebugVarDump(error_reporting());
     $DebugOutput[] = 'ini_get(error_reporting)    = ' . $this->phpThumbDebugVarDump(@ini_get('error_reporting'));
     $DebugOutput[] = 'ini_get(display_errors)     = ' . $this->phpThumbDebugVarDump(@ini_get('display_errors'));
     $DebugOutput[] = 'ini_get(allow_url_fopen)    = ' . $this->phpThumbDebugVarDump(@ini_get('allow_url_fopen'));
     $DebugOutput[] = 'ini_get(disable_functions)  = ' . $this->phpThumbDebugVarDump(@ini_get('disable_functions'));
     $DebugOutput[] = 'ini_get(safe_mode)          = ' . $this->phpThumbDebugVarDump(@ini_get('safe_mode'));
     $DebugOutput[] = 'ini_get(open_basedir)       = ' . $this->phpThumbDebugVarDump(@ini_get('open_basedir'));
     $DebugOutput[] = 'ini_get(memory_limit)       = ' . $this->phpThumbDebugVarDump(@ini_get('memory_limit'));
     $DebugOutput[] = 'ini_get(max_execution_time) = ' . $this->phpThumbDebugVarDump(@ini_get('max_execution_time'));
     $DebugOutput[] = 'get_cfg_var(memory_limit)   = ' . $this->phpThumbDebugVarDump(@get_cfg_var('memory_limit'));
     $DebugOutput[] = 'memory_get_usage()          = ' . (function_exists('memory_get_usage') ? $this->phpThumbDebugVarDump(@memory_get_usage()) : 'n/a');
     $DebugOutput[] = '';
     $DebugOutput[] = '$this->config_prefer_imagemagick            = ' . $this->phpThumbDebugVarDump($this->config_prefer_imagemagick);
     $DebugOutput[] = '$this->config_imagemagick_path              = ' . $this->phpThumbDebugVarDump($this->config_imagemagick_path);
     $DebugOutput[] = 'SafeExec(which convert)                     = ' . trim(phpthumb_functions::SafeExec('which convert'));
     $IMpathUsed = $this->config_imagemagick_path ? $this->config_imagemagick_path : trim(phpthumb_functions::SafeExec('which convert'));
     $DebugOutput[] = '[actual ImageMagick path used]              = ' . $this->phpThumbDebugVarDump($IMpathUsed);
     $DebugOutput[] = 'file_exists([actual ImageMagick path used]) = ' . $this->phpThumbDebugVarDump(file_exists($IMpathUsed));
     $DebugOutput[] = 'ImageMagickVersion()                        = ' . $this->ImageMagickVersion();
     $DebugOutput[] = '';
     $DebugOutput[] = '$this->config_cache_directory               = ' . $this->phpThumbDebugVarDump($this->config_cache_directory);
     $DebugOutput[] = '$this->config_cache_disable_warning         = ' . $this->phpThumbDebugVarDump($this->config_cache_disable_warning);
     $DebugOutput[] = '$this->config_cache_maxage                  = ' . $this->phpThumbDebugVarDump($this->config_cache_maxage);
     $DebugOutput[] = '$this->config_cache_maxsize                 = ' . $this->phpThumbDebugVarDump($this->config_cache_maxsize);
     $DebugOutput[] = '$this->config_cache_maxfiles                = ' . $this->phpThumbDebugVarDump($this->config_cache_maxfiles);
     $DebugOutput[] = '$this->cache_filename                       = ' . $this->phpThumbDebugVarDump($this->cache_filename);
     $DebugOutput[] = 'is_readable($this->config_cache_directory)  = ' . $this->phpThumbDebugVarDump(is_readable($this->config_cache_directory));
     $DebugOutput[] = 'is_writable($this->config_cache_directory)  = ' . $this->phpThumbDebugVarDump(is_writable($this->config_cache_directory));
     $DebugOutput[] = 'is_readable($this->cache_filename)          = ' . $this->phpThumbDebugVarDump(is_readable($this->cache_filename));
     $DebugOutput[] = 'is_writable($this->cache_filename)          = ' . (file_exists($this->cache_filename) ? $this->phpThumbDebugVarDump(is_writable($this->cache_filename)) : 'n/a');
     $DebugOutput[] = '';
     $DebugOutput[] = '$this->config_document_root                 = ' . $this->phpThumbDebugVarDump($this->config_document_root);
     $DebugOutput[] = '$this->config_temp_directory                = ' . $this->phpThumbDebugVarDump($this->config_temp_directory);
     $DebugOutput[] = '';
     $DebugOutput[] = '$this->config_output_format                 = ' . $this->phpThumbDebugVarDump($this->config_output_format);
     $DebugOutput[] = '$this->config_output_maxwidth               = ' . $this->phpThumbDebugVarDump($this->config_output_maxwidth);
     $DebugOutput[] = '$this->config_output_maxheight              = ' . $this->phpThumbDebugVarDump($this->config_output_maxheight);
     $DebugOutput[] = '';
     $DebugOutput[] = '$this->config_error_message_image_default   = ' . $this->phpThumbDebugVarDump($this->config_error_message_image_default);
     $DebugOutput[] = '$this->config_error_bgcolor                 = ' . $this->phpThumbDebugVarDump($this->config_error_bgcolor);
     $DebugOutput[] = '$this->config_error_textcolor               = ' . $this->phpThumbDebugVarDump($this->config_error_textcolor);
     $DebugOutput[] = '$this->config_error_fontsize                = ' . $this->phpThumbDebugVarDump($this->config_error_fontsize);
     $DebugOutput[] = '$this->config_error_die_on_error            = ' . $this->phpThumbDebugVarDump($this->config_error_die_on_error);
     $DebugOutput[] = '$this->config_error_silent_die_on_error     = ' . $this->phpThumbDebugVarDump($this->config_error_silent_die_on_error);
     $DebugOutput[] = '$this->config_error_die_on_source_failure   = ' . $this->phpThumbDebugVarDump($this->config_error_die_on_source_failure);
     $DebugOutput[] = '';
     $DebugOutput[] = '$this->config_nohotlink_enabled             = ' . $this->phpThumbDebugVarDump($this->config_nohotlink_enabled);
     $DebugOutput[] = '$this->config_nohotlink_valid_domains       = ' . $this->phpThumbDebugVarDump($this->config_nohotlink_valid_domains);
     $DebugOutput[] = '$this->config_nohotlink_erase_image         = ' . $this->phpThumbDebugVarDump($this->config_nohotlink_erase_image);
     $DebugOutput[] = '$this->config_nohotlink_text_message        = ' . $this->phpThumbDebugVarDump($this->config_nohotlink_text_message);
     $DebugOutput[] = '';
     $DebugOutput[] = '$this->config_nooffsitelink_enabled         = ' . $this->phpThumbDebugVarDump($this->config_nooffsitelink_enabled);
     $DebugOutput[] = '$this->config_nooffsitelink_valid_domains   = ' . $this->phpThumbDebugVarDump($this->config_nooffsitelink_valid_domains);
     $DebugOutput[] = '$this->config_nooffsitelink_require_refer   = ' . $this->phpThumbDebugVarDump($this->config_nooffsitelink_require_refer);
     $DebugOutput[] = '$this->config_nooffsitelink_erase_image     = ' . $this->phpThumbDebugVarDump($this->config_nooffsitelink_erase_image);
     $DebugOutput[] = '$this->config_nooffsitelink_text_message    = ' . $this->phpThumbDebugVarDump($this->config_nooffsitelink_text_message);
     $DebugOutput[] = '';
     $DebugOutput[] = '$this->config_high_security_enabled         = ' . $this->phpThumbDebugVarDump($this->config_high_security_enabled);
     $DebugOutput[] = '$this->config_allow_src_above_docroot       = ' . $this->phpThumbDebugVarDump($this->config_allow_src_above_docroot);
     $DebugOutput[] = '$this->config_allow_src_above_phpthumb      = ' . $this->phpThumbDebugVarDump($this->config_allow_src_above_phpthumb);
     $DebugOutput[] = '$this->config_allow_parameter_file          = ' . $this->phpThumbDebugVarDump($this->config_allow_parameter_file);
     $DebugOutput[] = '$this->config_allow_parameter_goto          = ' . $this->phpThumbDebugVarDump($this->config_allow_parameter_goto);
     $DebugOutput[] = '';
     $DebugOutput[] = '$this->config_max_source_pixels             = ' . $this->phpThumbDebugVarDump($this->config_max_source_pixels);
     $DebugOutput[] = '$this->config_use_exif_thumbnail_for_speed  = ' . $this->phpThumbDebugVarDump($this->config_use_exif_thumbnail_for_speed);
     $DebugOutput[] = '$this->config_border_hexcolor               = ' . $this->phpThumbDebugVarDump($this->config_border_hexcolor);
     $DebugOutput[] = '$this->config_background_hexcolor           = ' . $this->phpThumbDebugVarDump($this->config_background_hexcolor);
     $DebugOutput[] = '$this->config_ttf_directory                 = ' . $this->phpThumbDebugVarDump($this->config_ttf_directory);
     $DebugOutput[] = '';
     foreach ($OtherVariableNames as $varname) {
         $value = $this->{$varname};
         $DebugOutput[] = '$this->' . str_pad($varname, 27, ' ', STR_PAD_RIGHT) . ' = ' . $this->phpThumbDebugVarDump($value);
     }
     $DebugOutput[] = 'strlen($this->rawImageData)        = ' . strlen(@$this->rawImageData);
     $DebugOutput[] = 'strlen($this->exif_thumbnail_data) = ' . strlen(@$this->exif_thumbnail_data);
     $DebugOutput[] = '';
     foreach ($ParameterNames as $varname) {
//.........这里部分代码省略.........
开发者ID:alanhaggai,项目名称:plogger,代码行数:101,代码来源:phpthumb.class.php

示例2: ImageCreateFromStringReplacement

 function ImageCreateFromStringReplacement(&$RawImageData, $DieOnErrors = false)
 {
     // there are serious bugs in the non-bundled versions of GD which may cause
     // PHP to segfault when calling ImageCreateFromString() - avoid if at all possible
     // when not using a bundled version of GD2
     $gd_info = phpthumb_functions::gd_info();
     if (strpos($gd_info['GD Version'], 'bundled') !== false) {
         return @ImageCreateFromString($RawImageData);
     }
     switch (substr($RawImageData, 0, 3)) {
         case 'GIF':
             $ICFSreplacementFunctionName = 'ImageCreateFromGIF';
             break;
         case "ÿØÿ":
             $ICFSreplacementFunctionName = 'ImageCreateFromJPEG';
             break;
         case "‰" . 'PN':
             $ICFSreplacementFunctionName = 'ImageCreateFromPNG';
             break;
         default:
             $this->ErrorImage('Unknown image type identified by "' . substr($this->rawImageData, 0, 3) . '" (' . phpthumb_functions::HexCharDisplay(substr($this->rawImageData, 0, 3)) . ') in ImageCreateFromStringReplacement()');
             break;
     }
     if ($tempnam = tempnam($this->config_temp_directory, 'pThumb')) {
         if ($fp_tempnam = @fopen($tempnam, 'wb')) {
             fwrite($fp_tempnam, $RawImageData);
             fclose($fp_tempnam);
             if ($ICFSreplacementFunctionName == 'ImageCreateFromGIF' && !function_exists($ICFSreplacementFunctionName)) {
                 // Need to create from GIF file, but ImageCreateFromGIF does not exist
                 if (@(include_once 'phpthumb.gif.php')) {
                     // gif_loadFileToGDimageResource() cannot read from raw data, write to file first
                     if ($tempfilename = tempnam($this->config_temp_directory, 'pThumb')) {
                         if ($fp_tempfile = @fopen($tempfilename, 'wb')) {
                             fwrite($fp_tempfile, $RawImageData);
                             fclose($fp_tempfile);
                             $gdimg_source = gif_loadFileToGDimageResource($tempfilename);
                             unlink($tempfilename);
                             return $gdimg_source;
                             break;
                         } else {
                             $ErrorMessage = 'Failed to open tempfile in ' . __FILE__ . ' on line ' . __LINE__;
                         }
                     } else {
                         $ErrorMessage = 'Failed to open generate tempfile name in ' . __FILE__ . ' on line ' . __LINE__;
                     }
                 } else {
                     $ErrorMessage = 'Failed to include required file "phpthumb.gif.php" in ' . __FILE__ . ' on line ' . __LINE__;
                 }
             } elseif (function_exists($ICFSreplacementFunctionName) && ($gdimg_source = $ICFSreplacementFunctionName($tempnam))) {
                 // great
                 unlink($tempnam);
                 return $gdimg_source;
             } else {
                 // GD functions not available
                 // base64-encoded error image in GIF format
                 $ERROR_NOGD = 'R0lGODlhIAAgALMAAAAAABQUFCQkJDY2NkZGRldXV2ZmZnJycoaGhpSUlKWlpbe3t8XFxdXV1eTk5P7+/iwAAAAAIAAgAAAE/vDJSau9WILtTAACUinDNijZtAHfCojS4W5H+qxD8xibIDE9h0OwWaRWDIljJSkUJYsN4bihMB8th3IToAKs1VtYM75cyV8sZ8vygtOE5yMKmGbO4jRdICQCjHdlZzwzNW4qZSQmKDaNjhUMBX4BBAlmMywFSRWEmAI6b5gAlhNxokGhooAIK5o/pi9vEw4Lfj4OLTAUpj6IabMtCwlSFw0DCKBoFqwAB04AjI54PyZ+yY3TD0ss2YcVmN/gvpcu4TOyFivWqYJlbAHPpOntvxNAACcmGHjZzAZqzSzcq5fNjxFmAFw9iFRunD1epU6tsIPmFCAJnWYE0FURk7wJDA0MTKpEzoWAAskiAAA7';
                 header('Content-type: image/gif');
                 echo base64_decode($ERROR_NOGD);
                 exit;
             }
         } else {
             $ErrorMessage = 'Failed to fopen(' . $tempnam . ', "wb") in ' . __FILE__ . ' on line ' . __LINE__ . "\n" . 'You may need to set $PHPTHUMB_CONFIG[temp_directory] in phpthumb.config.php';
         }
         unlink($tempnam);
     } else {
         $ErrorMessage = 'Failed to generate tempnam() in ' . __FILE__ . ' on line ' . __LINE__ . "\n" . 'You may need to set $PHPTHUMB_CONFIG[temp_directory] in phpthumb.config.php';
     }
     if ($DieOnErrors && !empty($ErrorMessage)) {
         die($ErrorMessage);
     }
     return false;
 }
开发者ID:BackupTheBerlios,项目名称:ydframework-svn,代码行数:72,代码来源:phpthumb.class.php

示例3: gd_version

 function gd_version($fullstring = false)
 {
     static $cache_gd_version = array();
     if (empty($cache_gd_version)) {
         $gd_info = phpthumb_functions::gd_info();
         if (substr($gd_info['GD Version'], 0, strlen('bundled (')) == 'bundled (') {
             $cache_gd_version[1] = $gd_info['GD Version'];
             // e.g. "bundled (2.0.15 compatible)"
             $cache_gd_version[0] = (double) substr($gd_info['GD Version'], strlen('bundled ('), 3);
             // e.g. "2.0" (not "bundled (2.0.15 compatible)")
         } else {
             $cache_gd_version[1] = $gd_info['GD Version'];
             // e.g. "1.6.2 or higher"
             $cache_gd_version[0] = (double) substr($gd_info['GD Version'], 0, 3);
             // e.g. "1.6" (not "1.6.2 or higher")
         }
     }
     return $cache_gd_version[intval($fullstring)];
 }
开发者ID:chrismunden,项目名称:cmsfromscratch,代码行数:19,代码来源:phpthumb.functions.php


注:本文中的phpthumb_functions::gd_info方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。