Search⌘ K
AI Features

Dealing with Changes to the GD Extension

Explore the key updates to the GD extension in PHP 8, focusing on its migration from resources to objects, updated compile flags, and new function features. Understand how these changes affect image manipulation and compilation processes to better manage graphics in PHP 8.

The GD (Graphics Draw) extension is an image manipulation extension that leverages the GD library. GD originally stood for GIF Draw. Oddly, the GD library had to withdraw support for the Graphics Interchange Format (GIF) after Unisys revoked the open-source license for the compression technology used when generating GIFs. After 2004, however, the Unisys patent on this technology expired and GIF support was restored. As it stands today, the GD extension offers support for the Joint Photographic Experts Group (JPEG or JPG), Portable Network Graphic (PNG), GIF, X BitMap (XBM), X PixMap (XPM), Wireless Bitmap (WBMP), WebP, and Bitmap (BMP) formats.

Let’s now have a look at the impact of resource-to-object migration on the GD extension.

GD extension resource-to-object migration

As with other PHP ...