ImageStyle::flush

public ImageStyle::flush($path = NULL) Flushes cached media for this style. Parameters string $path: (optional) The original image path or URI. If it's supplied, only this image derivative will be flushed. Return value $this Overrides ImageStyleInterface::flush File core/modules/image/src/Entity/ImageStyle.php, line 243 Class ImageStyle Defines an image style configuration entity. Namespace Drupal\image\Entity Code public function flush($path = NULL) { // A specific image path has

ImageStyle::fileUriTarget

protected ImageStyle::fileUriTarget($uri) Provides a wrapper for file_uri_target() to allow unit testing. Returns the part of a URI after the schema. @todo: Convert file_uri_target() into a proper injectable service. Parameters string $uri: A stream, referenced as "scheme://target" or "data:target". Return value string|bool A string containing the target (path), or FALSE if none. For example, the URI "public://sample/test.txt" would return "sample/test.txt". See also file_uri_scheme() File c

ImageStyle::fileUriScheme

protected ImageStyle::fileUriScheme($uri) Provides a wrapper for file_uri_scheme() to allow unit testing. Returns the scheme of a URI (e.g. a stream). @todo: Remove when https://www.drupal.org/node/2050759 is in. Parameters string $uri: A stream, referenced as "scheme://target" or "data:target". Return value string A string containing the name of the scheme, or FALSE if none. For example, the URI "public://example.txt" would return "public". See also file_uri_target() File core/modules/image

ImageStyle::fileDefaultScheme

protected ImageStyle::fileDefaultScheme() Provides a wrapper for file_default_scheme() to allow unit testing. Gets the default file stream implementation. @todo: Convert file_default_scheme() into a proper injectable service. Return value string 'public', 'private' or any other file scheme defined as the default. File core/modules/image/src/Entity/ImageStyle.php, line 507 Class ImageStyle Defines an image style configuration entity. Namespace Drupal\image\Entity Code protected functio

ImageStyle::deleteImageEffect

public ImageStyle::deleteImageEffect(ImageEffectInterface $effect) Deletes an image effect from this style. Parameters \Drupal\image\ImageEffectInterface $effect: The image effect object. Return value $this Overrides ImageStyleInterface::deleteImageEffect File core/modules/image/src/Entity/ImageStyle.php, line 337 Class ImageStyle Defines an image style configuration entity. Namespace Drupal\image\Entity Code public function deleteImageEffect(ImageEffectInterface $effect) { $this-&

ImageStyle::createDerivative

public ImageStyle::createDerivative($original_uri, $derivative_uri) Creates a new image derivative based on this image style. Generates an image derivative applying all image effects and saving the resulting image. Parameters string $original_uri: Original image file URI. string $derivative_uri: Derivative image file URI. Return value bool TRUE if an image derivative was generated, or FALSE if the image derivative could not be generated. Overrides ImageStyleInterface::createDerivative File co

ImageStyle::buildUrl

public ImageStyle::buildUrl($path, $clean_urls = NULL) Returns the URL of this image derivative for an original image path or URI. Parameters string $path: The path or URI to the original image. mixed $clean_urls: (optional) Whether clean URLs are in use. Return value string The absolute URL where a style image can be downloaded, suitable for use in an <img> tag. Requesting the URL will cause the image to be created. Overrides ImageStyleInterface::buildUrl See also \Drupal\image\Contro

ImageStyle::buildUri

public ImageStyle::buildUri($uri) Returns the URI of this image when using this style. The path returned by this function may not exist. The default generation method only creates images when they are requested by a user's browser. Modules may implement this method to decide where to place derivatives. Parameters string $uri: The URI or path to the original image. Return value string The URI to the image derivative for this style. Overrides ImageStyleInterface::buildUri File core/modules/imag

ImageStyle::addImageEffect

public ImageStyle::addImageEffect(array $configuration) Saves an image effect for this style. Parameters array $configuration: An array of image effect configuration. Return value string The image effect ID. Overrides ImageStyleInterface::addImageEffect File core/modules/image/src/Entity/ImageStyle.php, line 371 Class ImageStyle Defines an image style configuration entity. Namespace Drupal\image\Entity Code public function addImageEffect(array $configuration) { $configuration['uuid

ImageStyle::addExtension

protected ImageStyle::addExtension($path) Adds an extension to a path. If this image style changes the extension of the derivative, this method adds the new extension to the given path. This way we avoid filename clashes while still allowing us to find the source image. Parameters string $path: The path to add the extension to. Return value string The given path if this image style doesn't change its extension, or the path with the added extension if it does. File core/modules/image/src/Entit