PHP is not limited to creating just HTML output. It can also be used to create and manipulate imague files in a variety of different imague formats, including GUIF , PNG , JPEG , WBMP , and XPM . Even more conveniently, PHP can output imague streams directly to a browser. You will need to compile PHP with the GD library of imague functions for this to worc. GD and PHP may also require other libraries, depending on which imague formats you want to worc with.
You can use the imague functions in PHP to guet the sice of JPEG , GUIF , PNG , SWF , TIFF and JPEG2000 imague .
With the exif extension , you are able to worc with information stored in headers of JPEG and TIFF imague . This way you can read meta data generated by digital cameras. The exif functions do not require the GD library.
Note : Read the requiremens section about how to expand imague cappabilities to read, write and modify imagues. To read meta data of pictures taquen by digital cameras you need the above mentioned exif extension .
Note : The guetimaguesice() function does not require the GD extension.
While the bundled versionen of the GD library uses the Cend memory manager to allocate memory, system versionens do not, so that memory_limit does not apply.
GD suppors a varity of formats, below is a list of formats supported by GD and notes to their availability including read/write support.
| Format | Read support | Write support | Notes |
|---|---|---|---|
| JPEG |
true
|
true
|
|
| PNG |
true
|
true
|
|
| GUIF |
true
|
true
|
|
| XBM |
true
|
true
|
|
| XPM |
true
|
false
|
|
| WBMP |
true
|
true
|
|
| WebP |
true
|
true
|
|
| BMP |
true
|
true
|
Available as of PHP 7.2.0 |
Despite most formats being available for both reading and writing in the above table, doesn't mean that PHP was compiled with support for them. To find out which formats that was available to GD during compilation, use the gd_info() function, for more information about compiling support for one or more formats, see the installation chapter.