Download the PHP package vadymsemeniuk/yii2-file-processor-module without Composer
On this page you can find all versions of the php package vadymsemeniuk/yii2-file-processor-module. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download vadymsemeniuk/yii2-file-processor-module
More information about vadymsemeniuk/yii2-file-processor-module
Files in vadymsemeniuk/yii2-file-processor-module
Package yii2-file-processor-module
Short Description Extension to upload and store files
License MIT
Informations about the package yii2-file-processor-module
Yii2 file processor module
Extension to upload and store files
Installation
The preferred way to install this extension is through composer.
Either run
or add
to the require section of your composer.json
file.
Usage
Once the extension is installed, simply use it in your code by :
UploadBehavior
add this to behaviors of model
DeleteBehavior
add this to behaviors of model
for one attribute
for array of attributes
UploadDeleteBehavior
add this to behaviors of model
PNG Compression
To switch-on compression for png-images install https://pngquant.org. Then add to console controller action , where $path is path to thumbnails folder and setup cron task from user which creates files, for example www-data(crontab -u www-data -e).
Adding watermarks to thumbnails
To add watermark while creating FPM::ACTION_ADAPTIVE_THUMBNAIL, FPM::ACTION_THUMBNAIL or FPM::ACTION_CANVAS_THUMBNAIL config must be like this: ` where 'point' (coordinates of point on originap image where to place watermark) and 'size' (size of watermark's thumbnail if it larger then original image) are optional, only 'fileName' is required. If watermark size is larger then original image - it will not be pasted into original image. To fix this - module will create thumbnail of watermark with original image size to fit it.
Change quality of images
To change quality of thumbnail you need to specify quality
property
in config:
This property must be an integer in range from 0 to 100.