Go Back   SZONE.US Forums > Do it yourself (DIY) > Web Tips

Web Tips Tips and tricks specializing in programming languages of the web. ie. PHP, MYSQL, XHTML, CSS, etc

[PHP] Check your server for GD support

Views:4141
Reply
Thread Tools Search this Thread Rate Thread
  #1  
Unread 02.18.07, 01:34 PM
Zachariah Boren's Avatar
Zachariah Boren Zachariah Boren is offline
Administrator
 
Join Date: 02.07
Location: Canoga Park, CA
Posts: 928
Blog Entries: 6
Images: 10075
Send a message via ICQ to Zachariah Boren Send a message via MSN to Zachariah Boren Send a message via twitter to Zachariah Boren
[PHP] Check your server for GD support

This might come in handy for some.

What is the GD library? GD is an open source code library for the dynamic creation of images by programmers. GD is written in C, and "wrappers" are available for Perl, PHP and other languages. GD creates PNG, JPEG and GIF images, among other formats. GD is commonly used to generate charts, graphics, thumbnails, and most anything else, on the fly. While not restricted to use on the web, the most common applications of GD involve web site development.


EX Output:
  • GD support: yes
  • GD Version: bundled (2.0.28 compatible)
  • FreeType Support: yes
  • FreeType Linkage: with freetype
  • T1Lib Support: no
  • GIF Read Support: yes
  • GIF Create Support: yes
  • JPG Support: yes
  • PNG Support: yes
  • WBMP Support: yes
  • XBM Support: yes
  • JIS-mapped Japanese Font Support: no

PHP Code:
<?php
// Check your server for GD support

function gdinfo(){
  echo 
"\n<ul><li>GD support: ";
    if(
function_exists("gd_info")){
        echo 
"<font color=\"#00ff00\">yes</font>";
        
$info gd_info();
        
$keys array_keys($info);
          for(
$i=0$i<count($keys); $i++) {
          if(
is_bool($info[$keys[$i]]))
              echo 
"</li>\n<li>" $keys[$i] .": " yesNo($info[$keys[$i]]);
              else
              echo 
"</li>\n<li>" $keys[$i] .": " $info[$keys[$i]];
          }
    }else{
        echo 
"<font color=\"#ff0000\">no</font>"; }
        echo 
"</li></ul>";
}

function 
yesNo($bool){
  if(
$bool) return "<font color=\"#00ff00\"> yes</font>";
  else return 
"<font color=\"#ff0000\"> no</font>";
}

echo 
gdinfo();

?>
__________________
http://www.szone.us | http://www.gzhq.net
Twitter | Facebook | My:Hacks @ vBulletin.org
Member of Kiwanis Club of Chatsworth
Reply With Quote
  #2  
Unread 08.31.10, 07:12 PM
billyy2288 billyy2288 is offline
Junior Member
 
Join Date: 08.10
Posts: 1
Thanks you for the post.
Reply With Quote
Reply

Tags
check, php, server, support

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:


Similar Threads
Thread Thread Starter Forum Replies Last Post
Standalone PHP Shoutcast Status Zachariah Boren Standalone 53 08.27.12 10:14 AM
Work Around - Error SQL server exceeded max questions Zachariah Boren Web Tips 0 02.09.09 06:10 PM
function.array-merge Argument #2 is not an array in modules vbgallery.php on line 49 niceguy vBulletin 5 12.30.07 09:57 AM
[PHP] CHMOD Recursive Zachariah Boren Web Tips 0 05.26.07 05:50 PM


All times are GMT -8. The time now is 09:35 AM.


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
Copyright 2007 - 20017 SZONE.US All rights reserved