Set the portrait.

@param array $config The portrait options [data,orientation,mimetype]
182260
public function setPortrait($config)
    {
        $config = new AnConfig($config);

        $config->append(array(
                'rotation' => 0,
                'mimetype' => 'image/jpeg',
        ));

        if ($config->url) {
            $config->append(array(
                'data' => file_get_contents($config->url),
            ));
        }

        $config->mimetype = strtolower($config->mimetype);

        //the allowed mimetypes
        $mimetypes = array('image/jpeg' => 'jpg','image/png' => 'png','image/gif' => 'gif');

        //force mimetype to jpeg if invalid
        //@TODO is this wise ?? No it isn't, but until we find a more reliable method to detect mimetypes
        if (!isset($mimetypes[$config->mimetype])) {
            $config->mimetype = 'image/jpeg';
        }

        if ($config->data) {
            $data = $config->data;

            if (empty($data)) {
                return false;
            }

            $config->append(array(
                'image' => imagecreatefromstring($data),
            ));
        }

        $image = $config->image;

        if (empty($image)) {
            return false;
        }

        $rotation = $config->rotation;

        switch ($rotation) {
            case 3:
                $rotation = 180;
                break;

            case 6:
                $rotation = -90;
                break;

            case 8:
                $rotation = 90;
                break;

            default :
                $rotation = 0;
        }

        if ($rotation != 0) {
            $image = imagerotate($image, $rotation, 0);
        }

        if ($this->persisted()) {
            $this->_mixer->removePortraitImage();
        }

        $images = $this->_mixer->resizePortraitImage($image);
        $this->_mixer->set('filename', md5(uniqid('', true)).'.'.$mimetypes[$config->mimetype]);
        $this->_mixer->set('mimetype', $config->mimetype);

        $sizes = array();
        $files = array();

        foreach ($images as $key => $value) {
            $filename = $this->_mixer->getPortraitFile($key);
            $sizes[$key] = $value['size'];
            $files[$filename] = AnHelperImage::output($value['data'], $config->mimetype);
        }

        imagedestroy($image);
        $this->_mixer->setValue('sizes', $sizes);
        $this->_pending_files[$this->_mixer] = $files;

        return true;
    }
103590
public function setConfig($config){
        $this->config = $config;
        foreach ($config as $key => $value) {
            $this->app->config($key, $value);
        }
    }
1047512
public function initialize(array $config)
    {
        if (!$this->getConfig('displayField')) {
            $this->setConfig('displayField', $this->_table->getDisplayField());
        }

        if ($this->getConfig('maxLength') === null) {
            $this->setConfig(
                'maxLength',
                $this->_table->getSchema()->getColumn($this->getConfig('field'))['length']
            );
        }

        if ($this->getConfig('unique') === true) {
            $this->setConfig('unique', [$this, '_uniqueSlug']);
        }
    }
1199329
private function setConfig($config)
	{
		foreach ($config as $key => $value) {
			$this->setConfigParam($key, $value);
		}

	}
1329193
public function setConfig($config = [])
    {
        if (!empty($config) && is_array($config)) {
            $this->config = $config;
        } else {
            $this->config = NULL;
        }
        $this->debug->debug(__FUNCTION__, '$this->config: ' . json_encode($this->config));

        return $this;
    }
1124414
protected function setModes(array $config)
	{
		if(isset($config['modes']))
		{
			$this->setCustomModes($config);
		}
		else if(isset($config['strict']))
		{
			if($config['strict'])
			{
				$this->pdo->prepare($this->strictMode())->execute();
			}
			else
			{
				$this->pdo->prepare("set session sql_mode='NO_ENGINE_SUBSTITUTION'")->execute();
			}
		}
	}
212565
public function manipulate(Config $config)
    {
        if ($this->isArrayAppend) {
            $this->appendToArraySetting($config);
        } else {
            $this->setSingleConfigValue($config);
        }
    }
469315
public function setConfig($config)
    {
        if (!is_array($config) && !$config instanceof ArrayAccess) {
            throw new InvalidArgumentException('Config has to be array or ArrayAccess');
        }
        $this->config = $config;

        return $this;
    }
1290797
public function setConfig($config)
    {
        if (is_array($config)) {
            $this->config = $config;
        } else {
            $this->config = (array) gplcart_config_get((string) $config);
            $this->setDb($this->config['database']);
            $this->config = array_merge($this->config, $this->select());
        }
    }
1079997
public function initialize(array $config = [])
    {
        if (count($config)) {
            $this->setConfig($config);
        } elseif (false !== ($config = config('view')->presenter)) {
            $this->setConfig($config);
        }

        // autoload presenter assets
        if (isset($config[ 'assets' ])) {
            $this->assets->autoload($config[ 'assets' ]);
        }

        // autoload presenter theme
        if(isset($config['theme'])) {
            $this->setTheme($config['theme']);
        }

        return $this;
    }
742189
protected function configure(array $config)
    {
        $this->width = $config['width'] ?? null;
        $this->height = $config['height'] ?? null;
        $this->position = $config['position'] ?? 'center';
        $this->interlace = $config['interlace'] ?? true;
    }
945210
public function setConfig(array $config)
    {
        foreach ($config as $key => $value) {
            $this->_config[$key] = $value;
        }

        return $this;
    }
1057711
public function setConfig(array $config)
    {
        foreach ($this->configurable as $setting) {
            if ( ! isset($config[$setting])) {
                continue;
            }

            $method = 'set' . ucfirst($setting);

            if (method_exists($this, $method)) {
                $this->$method($config[$setting]);
            }
        }

        return $this;
    }
237295
public function configure($config)
    {
        foreach ((array)$config as $key => $value) {
            $this->setConfig($key, $value);
        }
    }
797919
public function setConfig(array $config)
    {
        // Filter out unknown config keys, and use to override defaults
        $config = array_merge(
            $this->config,
            array_intersect_key($config, $this->config)
        );

        // Normalize allowMethods
        if (is_string($config['allowMethods'])) {
            $config['allowMethods'] = [$config['allowMethods']];
        }

        // Normalize allowHeaders
        if (is_string($config['allowHeaders'])) {
            $config['allowHeaders'] = [$config['allowHeaders']];
        }

        // Normalize allowOrigins
        if (is_string($config['allowOrigins'])) {
            $config['allowOrigins'] = [$config['allowOrigins']];
        }

        // Normalize allowCredentials
        $config['allowCredentials'] = (bool)$config['allowCredentials'];

        // Normalize maxAge
        $config['maxAge'] = (int)$config['maxAge'];

        /** @todo Check for use of wildcard in allowOrigins when allowCredentials equals true */

        // Set config as object attribute
        $this->config = $config;

        return $this;
    }
661739
public function setConfig($config = array()) 
    { 

    	if(is_array($config) ) {

    		if(!empty($config)) {
    			foreach($config as $key=>$value) {

    				$this->_config[$key] = $value;
    			}
    		}

     	} else {
    		
    		throw new Exception( "Invalid parameter");
    	}

    }
1071794
public static function setConfig(Config $config): void
    {
        if ($config->name() == 'application') {
            throw new ConfigException('Can\'t set config under \'application\' name; name \'application\' is not permitted because it shouldn\'t be possible to change those settings in runtime');
        }

        static::$configs[$config->name()] = $config;
    }