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:
@@ -23,7 +23,7 @@ $manager = new ImageManager('gd')
|
||||
$image = $manager->make('images/example.gif');
|
||||
|
||||
// resize image instance
|
||||
$image->resize(320, 240);
|
||||
$image->resize(height: 300);
|
||||
|
||||
// insert a watermark
|
||||
$image->place('images/watermark.png');
|
||||
@@ -37,7 +37,7 @@ $encoded->save('images/example.jpg');
|
||||
|
||||
## Requirements
|
||||
|
||||
- PHP >=8.0
|
||||
- PHP >= 8.1
|
||||
|
||||
## Supported Image Libraries
|
||||
|
||||
|
@@ -103,6 +103,16 @@ interface ImageInterface extends Traversable, Countable
|
||||
|
||||
public function pickColor(int $x, int $y, int $frame_key = 0): ?ColorInterface;
|
||||
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;
|
||||
|
||||
/**
|
||||
@@ -120,8 +130,29 @@ interface ImageInterface extends Traversable, Countable
|
||||
* @return 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;
|
||||
|
||||
|
||||
/**
|
||||
* 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 fill($color, ?int $x = null, ?int $y = null): ImageInterface;
|
||||
public function pixelate(int $size): ImageInterface;
|
||||
public function resize(?int $width = null, ?int $height = null): ImageInterface;
|
||||
|
Reference in New Issue
Block a user