You are here

function _image_style_quality_apply in Image Style Quality 7

This function is called when the image is ready for proccessing. It sets the sites quality setting to the percentage defined in our image style.

1 string reference to '_image_style_quality_apply'
image_style_quality_image_effect_info in ./image_style_quality.module
Implements hook_image_effect_info().

File

./image_style_quality.module, line 90
This module is intended to allow users to set custom quality settings on individual image styles with no core hacks.

Code

function _image_style_quality_apply(&$image, $data) {

  // Grab the quality from our image style.
  $image_style_quality = $data['quality'];

  // Set the sites internal quality to be the one defined by our image style.
  $GLOBALS['conf']['image_jpeg_quality'] = $image_style_quality;
  $GLOBALS['conf']['imagemagick_quality'] = $image_style_quality;
}