<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <title>Retrieve information about the currently installed GD library</title> </head> <body><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="ref.image.html">GD and Image Functions</a></div> <div class="next" style="text-align: right; float: right;"><a href="function.getimagesize.html">getimagesize</a></div> <div class="up"><a href="ref.image.html">GD and Image Functions</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div><hr /><div id="function.gd-info" class="refentry"> <div class="refnamediv"> <h1 class="refname">gd_info</h1> <p class="verinfo">(PHP 4 >= 4.3.0, PHP 5)</p><p class="refpurpose"><span class="refname">gd_info</span> — <span class="dc-title">Retrieve information about the currently installed GD library</span></p> </div> <div class="refsect1 description" id="refsect1-function.gd-info-description"> <h3 class="title">Description</h3> <div class="methodsynopsis dc-description"> <span class="type">array</span> <span class="methodname"><strong>gd_info</strong></span> ( <span class="methodparam">void</span> )</div> <p class="para rdfs-comment"> Gets information about the version and capabilities of the installed GD library. </p> </div> <div class="refsect1 returnvalues" id="refsect1-function.gd-info-returnvalues"> <h3 class="title">Return Values</h3> <p class="para"> Returns an associative array. </p> <p class="para"> <table class="doctable table"> <caption><strong>Elements of array returned by <span class="function"><strong>gd_info()</strong></span></strong></caption> <thead> <tr> <th>Attribute</th> <th>Meaning</th> </tr> </thead> <tbody class="tbody"> <tr> <td>GD Version</td> <td><span class="type"><a href="language.types.string.html" class="type string">string</a></span> value describing the installed <em>libgd</em> version.</td> </tr> <tr> <td>FreeType Support</td> <td><span class="type"><a href="language.types.boolean.html" class="type boolean">boolean</a></span> value. <strong><code>TRUE</code></strong> if FreeType Support is installed.</td> </tr> <tr> <td>FreeType Linkage</td> <td><span class="type"><a href="language.types.string.html" class="type string">string</a></span> value describing the way in which FreeType was linked. Expected values are: 'with freetype', 'with TTF library', and 'with unknown library'. This element will only be defined if <em>FreeType Support</em> evaluated to <strong><code>TRUE</code></strong>.</td> </tr> <tr> <td>T1Lib Support</td> <td><span class="type"><a href="language.types.boolean.html" class="type boolean">boolean</a></span> value. <strong><code>TRUE</code></strong> if <em>T1Lib</em> support is included.</td> </tr> <tr> <td>GIF Read Support</td> <td><span class="type"><a href="language.types.boolean.html" class="type boolean">boolean</a></span> value. <strong><code>TRUE</code></strong> if support for <em class="emphasis">reading</em> <em>GIF</em> images is included.</td> </tr> <tr> <td>GIF Create Support</td> <td><span class="type"><a href="language.types.boolean.html" class="type boolean">boolean</a></span> value. <strong><code>TRUE</code></strong> if support for <em class="emphasis">creating</em> <em>GIF</em> images is included.</td> </tr> <tr> <td>JPEG Support</td> <td><span class="type"><a href="language.types.boolean.html" class="type boolean">boolean</a></span> value. <strong><code>TRUE</code></strong> if <em>JPEG</em> support is included.</td> </tr> <tr> <td>PNG Support</td> <td><span class="type"><a href="language.types.boolean.html" class="type boolean">boolean</a></span> value. <strong><code>TRUE</code></strong> if <em>PNG</em> support is included.</td> </tr> <tr> <td>WBMP Support</td> <td><span class="type"><a href="language.types.boolean.html" class="type boolean">boolean</a></span> value. <strong><code>TRUE</code></strong> if <em>WBMP</em> support is included.</td> </tr> <tr> <td>XBM Support</td> <td><span class="type"><a href="language.types.boolean.html" class="type boolean">boolean</a></span> value. <strong><code>TRUE</code></strong> if <em>XBM</em> support is included.</td> </tr> <tr> <td>WebP Support</td> <td><span class="type"><a href="language.types.boolean.html" class="type boolean">boolean</a></span> value. <strong><code>TRUE</code></strong> if <em>WebP</em> support is included.</td> </tr> </tbody> </table> </p> <blockquote class="note"><p><strong class="note">Note</strong>: <p class="para"> Previous to PHP 5.3.0, the <em>JPEG Support</em> attribute was named <em>JPG Support</em>. </p> </p></blockquote> </div> <div class="refsect1 examples" id="refsect1-function.gd-info-examples"> <h3 class="title">Examples</h3> <p class="para"> <div class="example" id="example-3169"> <p><strong>Example #1 Using <span class="function"><strong>gd_info()</strong></span></strong></p> <div class="example-contents"> <div class="phpcode"><code><span style="color: #000000"> <span style="color: #0000BB"><?php<br />var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">gd_info</span><span style="color: #007700">());<br /></span><span style="color: #0000BB">?></span> </span> </code></div> </div> <div class="example-contents"><p>The above example will output something similar to:</p></div> <div class="example-contents screen"> <div class="cdata"><pre> array(9) { ["GD Version"]=> string(24) "bundled (2.0 compatible)" ["FreeType Support"]=> bool(false) ["T1Lib Support"]=> bool(false) ["GIF Read Support"]=> bool(true) ["GIF Create Support"]=> bool(false) ["JPEG Support"]=> bool(false) ["PNG Support"]=> bool(true) ["WBMP Support"]=> bool(true) ["XBM Support"]=> bool(false) } </pre></div> </div> </div> </p> </div> <div class="refsect1 changelog" id="refsect1-function.gd-info-changelog"> <h3 class="title">Changelog</h3> <p class="para"> <table class="doctable informaltable"> <thead> <tr> <th>Version</th> <th>Description</th> </tr> </thead> <tbody class="tbody"> <tr> <td>5.5.0</td> <td> <em>WebP Support</em> added. </td> </tr> <tr> <td>5.3.0</td> <td> <em>JPG Support</em> attribute renamed to <em>JPEG Support</em>. </td> </tr> </tbody> </table> </p> </div> <div class="refsect1 seealso" id="refsect1-function.gd-info-seealso"> <h3 class="title">See Also</h3> <p class="para"> <ul class="simplelist"> <li class="member"> <span class="function"><a href="function.imagepng.html" class="function" rel="rdfs-seeAlso">imagepng()</a> - Output a PNG image to either the browser or a file</span></li> <li class="member"> <span class="function"><a href="function.imagejpeg.html" class="function" rel="rdfs-seeAlso">imagejpeg()</a> - Output image to browser or file</span></li> <li class="member"> <span class="function"><a href="function.imagegif.html" class="function" rel="rdfs-seeAlso">imagegif()</a> - Output image to browser or file</span></li> <li class="member"> <span class="function"><a href="function.imagewbmp.html" class="function" rel="rdfs-seeAlso">imagewbmp()</a> - Output image to browser or file</span></li> <li class="member"> <span class="function"><a href="function.imagetypes.html" class="function" rel="rdfs-seeAlso">imagetypes()</a> - Return the image types supported by this PHP build</span></li> </ul> </p> </div> </div><hr /><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="ref.image.html">GD and Image Functions</a></div> <div class="next" style="text-align: right; float: right;"><a href="function.getimagesize.html">getimagesize</a></div> <div class="up"><a href="ref.image.html">GD and Image Functions</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div></body></html>