feat: Image saving for manga creation
This commit is contained in:
parent
50080f9779
commit
4017cabff2
23
tests/Domain/Manga/Adapter/InMemoryImageProcessor.php
Normal file
23
tests/Domain/Manga/Adapter/InMemoryImageProcessor.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace App\Tests\Domain\Manga\Adapter;
|
||||
|
||||
use App\Domain\Manga\Domain\Contract\Service\ImageProcessorInterface;
|
||||
|
||||
class InMemoryImageProcessor implements ImageProcessorInterface
|
||||
{
|
||||
private const string FULL_IMAGE_PATH = '/images/full';
|
||||
private const string THUMBNAIL_PATH = '/images/thumbnails';
|
||||
|
||||
public function downloadImage(string $imageUrl): string
|
||||
{
|
||||
$filename = sprintf('%s/%s.jpg', self::FULL_IMAGE_PATH, uniqid());
|
||||
return $filename;
|
||||
}
|
||||
|
||||
public function createThumbnail(string $originalImagePath): string
|
||||
{
|
||||
$filename = basename($originalImagePath);
|
||||
return sprintf('%s/%s', self::THUMBNAIL_PATH, $filename);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user