2017 © Pedro Peláez
 

library image-storage

Image storing utility that will help you save images into defined storages.

image

juniwalk/image-storage

Image storing utility that will help you save images into defined storages.

  • Tuesday, August 16, 2016
  • by juniwalk
  • Repository
  • 1 Watchers
  • 0 Stars
  • 25 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

Image Storage

Travis GitHub Release Total Donwloads Code Quality Tests Coverage License, (*1)

Image storing utility that will help you save images into defined storages., (*2)

Installation

$ composer require juniwalk/image-storage

Configuration

extensions:
    imageStorage: JuniWalk\ImageStorage\DI\ImageStorageExtension

imageStorage:
    directory: /images      # Relative to $wwwDir
    allowOverwrite: TRUE

Adding new storages

services:
    imageStorage.storage.avatar:
        class: JuniWalk\ImageStorage\Storages\LocalStorage(avatar, jpg)
        setup:
            - addFilter(JuniWalk\ImageStorage\Filters\ResizeFilter(512, 512, 'EXACT'))
            - addFilter(JuniWalk\ImageStorage\Filters\WatermarkFilter(%wwwDir%/images/watermark.png))

Usage

/** @var JuniWalk\ImageStorage\Media */
$media = Media::fromImage(string $name, Nette\Utils\Image $image)
$media = Media::fromUpload(Nette\Http\FileUpload $fileUpload, string $name = NULL);
$media = Media::fromFile(string $filename);
$media = Media::fromString(string $name, string $content);

/** @var \JuniWalk\ImageStorage\ImageStorage */
$imageStorage = $this->getImageStorage();

/** @var string  Relative path to $wwwDir */
$path = $imageStorage->store(string $storage, Media $media);

The Versions

16/08 2016

dev-master

9999999-dev

Image storing utility that will help you save images into defined storages.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Martin Procházka

image storage

16/08 2016

v1.0.0

1.0.0.0

Image storing utility that will help you save images into defined storages.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Martin Procházka

image storage