seiweb/yii2-image

This package is not installable via Composer 1.x, please make sure you upgrade to Composer 2+. Read more about our Composer 1.x deprecation policy.

Simple Image Uploader

Installs: 3

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 2

Forks: 0

Open Issues: 0

Type:yii2-extension

1.0.0 2020-01-01 02:29 UTC

This package is auto-updated.

Last update: 2021-12-04 14:14:19 UTC


README

Установка

$ composer require seiweb/yii2-image "*"

Настройка

 'modules'=>[
        'swb_image' => [
            'class' => 'seiweb\image\Module',
            'components'=>[
                'storage'=>[
                    'class'=>'common\CustomStorage',
                    'originalDor'=>'_original', // сюда складываются оригиналы
                    'cacheDir'=>'_modified', //сюда складываются всякие превью
                ],
                'imageManager'=>[
                    'class'=>\Intervention\Image\ImageManager::class,
                    'config'=>['driver'=>'imagick'] //or imagick
                ]
            ],
            'originalResizeTo'=>[1280,768], //уменьшать загружаемый файл до
            'maxFileCount'=>15,
            //'watermarkFilePath' => '@frontend/web/uploads/watermark.png',
            'watermarkOpacity'=>20,
            'uploadFileMaxSize'=>1000*1000*2
        ],
    ]

Применение миграций

 php yii migrate/up --migrationPath=@seiweb/image/migrations