Skip to content

Commit

Permalink
Added 'fetch format' parameter for cloudinary crop.
Browse files Browse the repository at this point in the history
  • Loading branch information
grask0 committed Feb 18, 2019
1 parent 69323cb commit 74277c2
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/Plugin/ImageEffect/CloudinaryCrop.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ public function defaultConfiguration() {
'degrees' => NULL,
'default_image' => NULL,
'quality' => NULL,
'fetch_format' => NULL,
);
}

Expand Down Expand Up @@ -357,7 +358,16 @@ public function buildConfigurationForm(array $form, FormStateInterface $form_sta
'#attributes' => array('class' => array('quality')),
);


$form['cloudinary']['more']['one']['fetch_format'] = array(
'#type' => 'textfield',
'#parents' => array('data', 'fetch_format'),
'#title' => t('Fetch format'),
'#default_value' => $this->configuration['fetch_format'],
'#size' => 15,
'#maxlength' => 15,
'#attributes' => array('class' => array('fetch_format')),
);

return $form;
}

Expand Down Expand Up @@ -438,6 +448,7 @@ public function submitConfigurationForm(array &$form, FormStateInterface $form_s
$this->configuration['background'] = $form_state->getValue('background');
$this->configuration['default_image'] = $form_state->getValue('default_image');
$this->configuration['quality'] = $form_state->getValue('quality');
$this->configuration['fetch_format'] = $form_state->getValue('fetch_format');
/* Maybe put ignore proportion in here as a Y/N or boolean */
}

Expand Down

0 comments on commit 74277c2

Please sign in to comment.