You are here

function _media_crop_apply_image_style in Media crop 7

Helper function to apply image style to an image.

Parameters

string $style: Name of the style to apply after rotation and cropping.

object $image: Image object to modify.

1 call to _media_crop_apply_image_style()
media_crop_create_derivative in ./media_crop.module
Helper function to create a derivative of an image.

File

./media_crop.module, line 807
Media crop primary module file.

Code

function _media_crop_apply_image_style($style, $image) {
  if (!empty($style) && $style !== NULL) {
    $safe = _media_crop_effects_are_compatible($style['effects']);
    foreach ($style['effects'] as $effect) {
      if (!($safe && ($effect['name'] == 'image_rotate' || $effect['name'] == 'image_crop'))) {
        image_effect_apply($image, $effect);
      }
    }
  }
}