Download the PHP package shadesoft/gd-image without Composer
On this page you can find all versions of the php package shadesoft/gd-image. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package gd-image
GDImage
An image editing package using PHP's GD library.
Installation
Open a command console, enter your project directory and execute the following command to download the latest stable version of this bundle:
This command requires you to have Composer installed globally, as explained in the installation chapter of the Composer documentation.
Usage
Image Converter
Available functions
-
image ( string | GdImage $image ) : self
Set source image from file path or image resource
-
target ( string $path ) : self
Set target path
-
quality ( int quality ) : self
Set output quality - accepted value is a percentage
-
background ( int red, int green, int blue ) : self
Set background color instead of transparency - accepted values are integers between 0 and 255
-
toAvif() | toBmp() | toGif() | toJpg() | toJpeg() | toPng() | toWebp() : self
Set output format
-
save() : string
Save generated image
-
output() : void
Print image to PHP output
Image Sizer
Available functions
See available functions at Converter, all of them are available here, too
-
image ( string | GdImage $image ) : self
Set source image from file path or image resource
-
instance(): GdImage
Return current image resource
-
widen ( int $width ) : self
Set the image to the given width while preserving its ratio
-
heighten ( int $height ) : self
Set the image to the given height while preserving its ratio
-
maximize ( int $width, int $height ) : self
Maximize image's size by its longer dimension while preserving its ratio
-
crop ( int $width, int $height [, int $x [, int $y]] ) : self
Crop picture to given dimensions starting at the given position
-
thumbnail ( int $width, int $height ) : self
Make a thumbnail by cropping the image by its shorter dimension (centered crop)
Cached Image Sizer
Same as Image Sizer but it uses cache.
Twig integration
If you use Twig, you can include the extensions
sbolch\GDImage\Twig\ConverterExtension([string $docroot])
sbolch\GDImage\Twig\SizerExtension([string $docroot [, string $cacheDir]])
You can override the default PHP document root with the optional $docroot parameter for both extensions.
You can use the cache mechanism in SizerExtension by using the optional $cacheDir parameter with your desired cache folder.
Then you can use the below filters (question mark marks optional parameters)
Phar mode (only Converter yet)
You can download the phar file on the releases page and use it as below:
- -i (--input) : Input file
- -o (--output) : Output file (optional - you must use -o or -f)
- -f (--format) : Output format (optional - you must use -o or -f)
- -q (--quality): Encoding quality as percentage (optional)
All versions of gd-image with dependencies
ext-gd Version *