| 1 |
<?php |
| 2 |
|
| 3 |
declare(strict_types=1); |
| 4 |
|
| 5 |
namespace AATXT\App\Infrastructure\Http; |
| 6 |
|
| 7 |
/** |
| 8 |
* Interface for reading image bytes to be sent inline to AI providers. |
| 9 |
* |
| 10 |
* Abstracts filesystem and HTTP access so providers stay testable. |
| 11 |
*/ |
| 12 |
interface ImageFetcherInterface |
| 13 |
{ |
| 14 |
/** |
| 15 |
* Read an image and return its raw bytes base64-encoded. |
| 16 |
* |
| 17 |
* @param string $imageUrl The image URL |
| 18 |
* |
| 19 |
* @return string The base64-encoded image contents |
| 20 |
* |
| 21 |
* @throws \Exception If the image cannot be read |
| 22 |
*/ |
| 23 |
public function fetchAsBase64(string $imageUrl): string; |
| 24 |
} |
| 25 |
|