public function TestProcessorAppendCharacters::applyToImage in Image Optimize (or ImageAPI Optimize) 8.3
Same name and namespace in other branches
- 8.2 tests/module/imageapi_optimize_module_test/src/Plugin/ImageAPIOptimizeProcessor/TestProcessorAppendCharacters.php \Drupal\imageapi_optimize_module_test\Plugin\ImageAPIOptimizeProcessor\TestProcessorAppendCharacters::applyToImage()
- 4.x tests/module/imageapi_optimize_module_test/src/Plugin/ImageAPIOptimizeProcessor/TestProcessorAppendCharacters.php \Drupal\imageapi_optimize_module_test\Plugin\ImageAPIOptimizeProcessor\TestProcessorAppendCharacters::applyToImage()
Apply this image optimize processor to the given image.
Image processors should modify the file in-place or overwrite the file on disk with an optimized version.
Parameters
string $image_uri: Original image file URI.
Return value
bool TRUE if an optimized image was generated, or FALSE if the image could not be optimized.
Overrides ImageAPIOptimizeProcessorInterface::applyToImage
File
- tests/
module/ imageapi_optimize_module_test/ src/ Plugin/ ImageAPIOptimizeProcessor/ TestProcessorAppendCharacters.php, line 21
Class
- TestProcessorAppendCharacters
- Optimizes an image by making it 10 characters longer.
Namespace
Drupal\imageapi_optimize_module_test\Plugin\ImageAPIOptimizeProcessorCode
public function applyToImage($image_uri) {
return (bool) file_put_contents($image_uri, file_get_contents($image_uri) . str_repeat('1', 10));
}