classes/Models/Image.php
public function getConfig()
    {
        // Create default keys for the config
        $config = array_merge([
            'width'   => null,
            'height'  => null,
            'options' => null,
        ], $this->config);

        // Add crops
        if ($crop = $this->getAttributeValue('crop_box')) {
            if (!is_array($config['options'])) {
                $config['options'] = [];
            }
            $config['options']['trim_perc'] = [
                round($crop->x1, 4),
                round($crop->y1, 4),
                round($crop->x2, 4),
                round($crop->y2, 4),
            ];
        }

        // Return config
        return $config;
    }
public function getConfig()
    {
        // Create default keys for the config
        $config = array_merge([
            'width'   => null,
            'height'  => null,
            'options' => null,
        ], $this->config);

        // Add crops
        if ($crop = $this->getAttributeValue('crop_box')) {
            if (!is_array($config['options'])) {
                $config['options'] = [];
            }
            $config['options']['trim_perc'] = [
                round($crop->x1, 4),
                round($crop->y1, 4),
                round($crop->x2, 4),
                round($crop->y2, 4),
            ];
        }

        // Return config
        return $config;
    }
public function getConfig ( ) { // Create default keys for the config $ config = array_merge ( [ 'width' => null , 'height' => null , 'options' => null , ] , $ this -> config ) ; // Add crops if ( $ crop = $ this -> getAttributeValue ( 'crop_box' ) ) { if ( ! is_array ( $ config [ 'options' ] ) ) { $ config [ 'options' ] = [ ] ; } $ config [ 'options' ] [ 'trim_perc' ] = [ round ( $ crop -> x1 , 4 ) , round ( $ crop -> y1 , 4 ) , round ( $ crop -> x2 , 4 ) , round ( $ crop -> y2 , 4 ) , ] ; } // Return config return $ config ; }
Get the config, merging defaults in so that all keys in the array are
present.  This also applies the crop choices from the DB.

@return array
Get the config merging defaults in so that all keys in the array are present . This also applies the crop choices from the DB .