PHP code example of vaersaagod / assetmate

1. Go to this page and download the library: Download vaersaagod/assetmate library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

vaersaagod / assetmate example snippets




use craft\elements\Asset;

return [
    'volumes' => [
        '*' => [
            'validation' => [
                'size' => [
                    'max' => '20M',
                ]
            ]
        ],
        'images' => [
            'validation' => [
                'extensions' => ['gif', 'jpg', 'jpeg', 'png'],
                'size' => [
                    'max' => '2M',
                ],
                'dimensions' => [
                    'maxWidth' => 2200, 
                    'maxHeight' => 2200,
                    'minWidth' => 200, 
                    'minHeight' => 200,
                ],
                'autoValidateResizeDimensions' => true,
            ],
            'resize' => [
                'maxWidth' => 2200,
                'maxHeight' => 2200,
                'quality' => 90,
            ],
            'convertUnmanipulable' => true,
        ],        
        'illustrations' => [
            'validation' => [
                'extensions' => ['svg'],
                'size' => [
                    'max' => '1M',
                    'min' => '50K',
                ]
            ]
        ],        
        'videos' => [
            'validation' => [
                'extensions' => ['mp4'],
                'size' => [
                    'max' => '12M',
                ],
            ],
        ],
    ]
];