1
0
mirror of https://github.com/Intervention/image.git synced 2025-08-20 12:41:23 +02:00

Change code examples and requirements in readme

This commit is contained in:
Oliver Vogel
2023-09-29 17:06:31 +02:00
parent b8f753b33f
commit cdee873d8a
2 changed files with 39 additions and 8 deletions

View File

@@ -23,7 +23,7 @@ $manager = new ImageManager('gd')
$image = $manager->make('images/example.gif'); $image = $manager->make('images/example.gif');
// resize image instance // resize image instance
$image->resize(320, 240); $image->resize(height: 300);
// insert a watermark // insert a watermark
$image->place('images/watermark.png'); $image->place('images/watermark.png');
@@ -37,7 +37,7 @@ $encoded->save('images/example.jpg');
## Requirements ## Requirements
- PHP >=8.0 - PHP >= 8.1
## Supported Image Libraries ## Supported Image Libraries

View File

@@ -103,6 +103,16 @@ interface ImageInterface extends Traversable, Countable
public function pickColor(int $x, int $y, int $frame_key = 0): ?ColorInterface; public function pickColor(int $x, int $y, int $frame_key = 0): ?ColorInterface;
public function pickColors(int $x, int $y): CollectionInterface; public function pickColors(int $x, int $y): CollectionInterface;
/**
* Draw text on image
*
* @param string $text
* @param int $x
* @param int $y
* @param null|callable $init
* @return ImageInterface
*/
public function text(string $text, int $x, int $y, ?callable $init = null): ImageInterface; public function text(string $text, int $x, int $y, ?callable $init = null): ImageInterface;
/** /**
@@ -120,8 +130,29 @@ interface ImageInterface extends Traversable, Countable
* @return ImageInterface * @return ImageInterface
*/ */
public function blur(int $amount = 5): ImageInterface; public function blur(int $amount = 5): ImageInterface;
/**
* Rotate current image by given angle
*
* @param float $angle
* @param string $background
* @return ImageInterface
*/
public function rotate(float $angle, $background = 'ffffff'): ImageInterface; public function rotate(float $angle, $background = 'ffffff'): ImageInterface;
/**
* Place another image into the current image instance
*
* @param mixed $element
* @param string $position
* @param int $offset_x
* @param int $offset_y
* @return ImageInterface
*/
public function place($element, string $position = 'top-left', int $offset_x = 0, int $offset_y = 0): ImageInterface; public function place($element, string $position = 'top-left', int $offset_x = 0, int $offset_y = 0): ImageInterface;
public function fill($color, ?int $x = null, ?int $y = null): ImageInterface; public function fill($color, ?int $x = null, ?int $y = null): ImageInterface;
public function pixelate(int $size): ImageInterface; public function pixelate(int $size): ImageInterface;
public function resize(?int $width = null, ?int $height = null): ImageInterface; public function resize(?int $width = null, ?int $height = null): ImageInterface;