| Conditions | 2 |
| Paths | 2 |
| Total Lines | 15 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 16 | public function crop(): Image |
||
| 17 | { |
||
| 18 | /** @var \AhmadMayahi\Vision\Data\CropHints $hint */ |
||
| 19 | foreach ($this->cropHints->detect() as $hint) { |
||
| 20 | $bounds = $hint->bounds; |
||
| 21 | |||
| 22 | $this->image->cropImage( |
||
| 23 | x: $bounds[0]->x, |
||
| 24 | y: $bounds[0]->y, |
||
| 25 | width: $bounds[2]->x - 1, |
||
| 26 | height: $bounds[2]->y - 1, |
||
| 27 | ); |
||
| 28 | } |
||
| 29 | |||
| 30 | return $this->image; |
||
| 31 | } |
||
| 33 |