Drupal 8  8.0.2
CropImageEffect Class Reference
Inheritance diagram for CropImageEffect:

Public Member Functions

 applyEffect (ImageInterface $image)
 
 getSummary ()
 
 defaultConfiguration ()
 
 buildConfigurationForm (array $form, FormStateInterface $form_state)
 
 submitConfigurationForm (array &$form, FormStateInterface $form_state)
 
- Public Member Functions inherited from ResizeImageEffect
 applyEffect (ImageInterface $image)
 
 transformDimensions (array &$dimensions, $uri)
 
 getSummary ()
 
 defaultConfiguration ()
 
 buildConfigurationForm (array $form, FormStateInterface $form_state)
 
 submitConfigurationForm (array &$form, FormStateInterface $form_state)
 
- Public Member Functions inherited from ConfigurableImageEffectBase
 validateConfigurationForm (array &$form, FormStateInterface $form_state)
 
 submitConfigurationForm (array &$form, FormStateInterface $form_state)
 
- Public Member Functions inherited from ImageEffectBase
 __construct (array $configuration, $plugin_id, $plugin_definition, LoggerInterface $logger)
 
 transformDimensions (array &$dimensions, $uri)
 
 getDerivativeExtension ($extension)
 
 getSummary ()
 
 label ()
 
 getUuid ()
 
 setWeight ($weight)
 
 getWeight ()
 
 getConfiguration ()
 
 setConfiguration (array $configuration)
 
 defaultConfiguration ()
 
 calculateDependencies ()
 
- Public Member Functions inherited from PluginInspectionInterface
 getPluginId ()
 
 getPluginDefinition ()
 

Additional Inherited Members

- Static Public Member Functions inherited from ImageEffectBase
static create (ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition)
 
- Protected Attributes inherited from ImageEffectBase
 $uuid
 
 $weight = ''
 
 $logger
 

Detailed Description

Crops an image resource.

( id = "image_crop", label = ("Crop"), description = ("Resizing will make images an exact set of dimensions. This may cause images to be stretched or shrunk disproportionately.") )

Member Function Documentation

applyEffect ( ImageInterface  $image)

{Applies an image effect to the image object.

Parameters
\Drupal\Core\Image\ImageInterface$imageAn image file object.
Returns
bool TRUE on success. FALSE if unable to perform the image effect on the image.
}

Implements ImageEffectInterface.

References ImageInterface\crop(), ImageInterface\getHeight(), ImageInterface\getMimeType(), ImageInterface\getSource(), ImageInterface\getToolkitId(), ImageInterface\getWidth(), and Drupal\logger().

Here is the call graph for this function:

buildConfigurationForm ( array  $form,
FormStateInterface  $form_state 
)

{Form constructor.Plugin forms are embedded in other forms. In order to know where the plugin form is located in the parent form, #parents and #array_parents must be known, but these are not available during the initial build phase. In order to have these properties available when building the plugin form's elements, let this method return a form element that has a #process callback and build the rest of the form in the callback. By the time the callback is executed, the element's #parents and #array_parents properties will have been set by the form API. For more documentation on #parents and #array_parents, see .

Parameters
array$formAn associative array containing the initial structure of the plugin form.
\Drupal\Core\Form\FormStateInterface$form_stateThe current state of the complete form.
Returns
array The form structure.
}

Implements PluginFormInterface.

References t().

Here is the call graph for this function:

defaultConfiguration ( )

{Gets default configuration for this plugin.

Returns
array An associative array with the default configuration.
}

Implements ConfigurablePluginInterface.

getSummary ( )

{Returns a render array summarizing the configuration of the image effect.

Returns
array A render array.
}

Implements ImageEffectInterface.

submitConfigurationForm ( array &  $form,
FormStateInterface  $form_state 
)

{Form submission handler.

Parameters
array$formAn associative array containing the structure of the plugin form as built by static::buildConfigurationForm().
\Drupal\Core\Form\FormStateInterface$form_stateThe current state of the complete form.
}

Implements PluginFormInterface.

References FormStateInterface\getValue().

Here is the call graph for this function:


The documentation for this class was generated from the following file: