function panopoly_images_file_displays_alter in Panopoly 7
Implementation of hook_file_displays_alter()
This function is designed to readjust the width and height properties in the WYSIWYG. See this issue for more background - http://drupal.org/node/1801308.
File
- modules/
panopoly/ panopoly_images/ panopoly_images.module, line 106
Code
function panopoly_images_file_displays_alter(&$displays, &$file, &$view_mode) {
if (!empty($file->override['attributes']['width'])) {
$file->image_dimensions['width'] = $file->override['attributes']['width'];
}
if (!empty($file->override['attributes']['height'])) {
$file->image_dimensions['height'] = $file->override['attributes']['height'];
}
}