You are here

function tinypng_entity_presave in TinyPNG 8

Implements hook_entity_presave().

Process the image with TinyPNG service.

File

./tinypng.module, line 17
TinyPng module.

Code

function tinypng_entity_presave(EntityInterface $entity) {

  /** @var \Drupal\tinypng\TinyPngImageHandlerInterface $service */
  $service = \Drupal::service('tinypng.image_handler');
  $service
    ->hookEntityPresave($entity);
}