Drupal 8  8.0.2
ConvertImageEffect Class Reference
Inheritance diagram for ConvertImageEffect:

Public Member Functions

 applyEffect (ImageInterface $image)
 
 getDerivativeExtension ($extension)
 
 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

Converts an image resource.

( id = "image_convert", label = ("Convert"), description = ("Converts an image between extensions (e.g. from PNG to JPEG).") )

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\convert(), ImageInterface\getMimeType(), ImageInterface\getSource(), ImageInterface\getToolkitId(), 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 Drupal\service(), and 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.

getDerivativeExtension (   $extension)

{Returns the extension the derivative would have have after applying this image effect.

Parameters
string$extensionThe file extension the derivative has before applying.
Returns
string The file extension after applying.
}

Implements ImageEffectInterface.

getSummary ( )

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

Returns
array A render array.
}

Implements ImageEffectInterface.

References Unicode\strtoupper().

Here is the call graph for this function:

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: