Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions classes/image/driver.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,10 @@ public function config($index = null, $value = null)
public function preset($name)
{
$vars = func_get_args();
if (isset($this->config['presets'][$name]))
if (\Arr::get($this->config['presets'], $name))
{
$old_config = $this->config;
$this->config = array_merge($this->config, $this->config['presets'][$name]);
$this->config = array_merge($this->config, \Arr::get($this->config['presets'], $name));
foreach ($this->config['actions'] AS $action)
{
$func = $action[0];
Expand Down
39 changes: 28 additions & 11 deletions config/image.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
*
*/

return array(

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coding standards, no short array notation please.

return [
/**
* -------------------------------------------------------------------------
* Driver
Expand Down Expand Up @@ -167,16 +167,33 @@
*
* Example:
*
* 'example' => array(
* 'example' => [
* 'quality' => 100,
* 'bgcolor' => null,
* 'actions' => array(
* array('crop_resize', 200, 200),
* array('border', 20, "#f00"),
* array('rounded', 10),
* array('output', 'png')
* )
* )
* 'actions' => [
* ['crop_resize', 200, 200],
* ['border', 20, "#f00"],
* ['rounded', 10],
* ['output', 'png']
* ]
* ],
* 'example_multilevel' => [
* 'thumbnail' => [
* 'quality' => 100,
* 'bgcolor' => null,
* 'actions' => [
* ['crop_resize', 175, 175]
* ]
* ],
* 'preview' => [
* 'quality' => 100,
* 'bgcolor' => null,
* 'actions' => [
* ['crop_resize', 200, 400]
* ]
* ]
* ]
*
*
* [!] WARNING:
*
Expand All @@ -185,5 +202,5 @@
*
*/

'presets' => array(),
);
'presets' => [],
];