Skip to content

Latest commit

 

History

History
35 lines (26 loc) · 767 Bytes

File metadata and controls

35 lines (26 loc) · 767 Bytes

marko/media-gd

GD image processing for marko/media — resize, crop, and convert images using PHP's built-in GD extension with no additional system dependencies.

Installation

composer require marko/media-gd

Quick Example

use Marko\Media\Contracts\ImageProcessorInterface;

class ImageService
{
    public function __construct(
        private ImageProcessorInterface $imageProcessor,
    ) {}

    public function resizeForWeb(string $imagePath): string
    {
        return $this->imageProcessor->resize(
            imagePath: $imagePath,
            width: 800,
            height: 600,
        );
    }
}

Documentation

Full usage, API reference, and examples: marko/media-gd