#New Features
Intervention Image 3 has been rewritten from the ground up with very little code carried over from the previous version. This means a more modern and sophisticated architecture and API that takes advantage of the modern features of PHP 8+. There are a few key features that further improve the library.
- Support of animated GIF with GD and Imagick drivers
- Configurable Image Manager
- Support for colorspaces
- Support for text wrapping in font system
- Support for line height in font system
- Object for encoded images
#API Changes
- canvas() is now handled by create()
- circle() is now handled by drawCircle()
- crop() still exists but has a new signature
- ellipse() is now handled by drawEllipse()
- line() has been replaced by drawLine()
- pixel() is handled by drawPixel()
- encode() still exists but has a new signature
- exif() is now handled by exif() with a different signature
- fill() currently only supports color values
- filter() is now handled by modify()
- flip() still exists but has a new signature and is handled by flip() and flop()
- insert() has been replaced by place()
- make() has been replaced by read()
- mime() is now handled by an encoded image only
- pickColor() has a different signature without format which is handled by the color class
- polygon() is handled by drawPolygon()
- rectangle() is handled by drawRectangle()
- text() still exists but has a new signature
- resizeCanvas() still exists but has a new signature
- limitColors() is handled by reduceColors
- trim() exists as of version
3.6, but works differently and automatically removes border areas of the image with similar colors - getCore() is replaced with core() but behaves completely differently
- orientate() is handled by orient() and is applied automatically by default (configurable)
- resize() still exists but has a different signature without a callback. The constraint option combinations are handled in a different way by the following other methods resizeDown(), scale() and scaleDown()
- widen() and heighten() are replaced by calling scale() and scaleDown() with named arguments
- fit() is replaced by cover() and coverDown()
#Removed Features
- interlace() no longer exists and is handle by encoder options.
- backup() and reset() no longer exist but the functionality can be achieved with native object cloning
- basepath() no longer exists
- cache() no longer exists
- filesize() no longer exists
- iptc() no longer exists
- mask() no longer exists
- opacity() no longer exists
- psrResponse() no longer exists
- response() no longer exists
- stream() no longer exists but you may use toFilePointer()
- destroy() no longer exists but you can use PHP's own functions, such as unset, to free memory
#Other Changes
-
The caching library of Intervention Image 2 is not supported by the new version.
-
The service providers for the Laravel framework were removed to avoid a dependency to the framework and to highlight Intervention Image rather framework agnostic, which it always was. However, there is an official package for Laravel integration
-
It is no longer possible to create images from an URI directly. The data must first be loaded by a dedicated HTTP client and then passed to the image library. Intervention Image is not responsible for HTTP client operations.
-
It is no longer possible to pass color values as array.
-
If you use the Laravel framework and a configuration file, it is necessary to adjust the
driversettings option. In version 2, the driver was configured via a string such asgdorimagick. In version 3, this is done via the class name of the driver likeIntervention\Image\Drivers\Imagick\DriverorIntervention\Image\Drivers\Gd\Driver. Read further details about configuration and Laravel Integration