You are here

function imagemagick_advanced_auto_orient_effect in ImageMagick 7

Image effect callback; Automatically adjusts the orientation of an image resource.

Parameters

$image: An image object returned by image_load().

Return value

TRUE on success. FALSE on failure.

See also

imagemagick_auto_orient()

1 string reference to 'imagemagick_advanced_auto_orient_effect'
imagemagick_advanced_image_effect_info in imagemagick_advanced/imagemagick_advanced.module
Implements hook_image_effect_info().

File

imagemagick_advanced/imagemagick_advanced.module, line 209
Provides advanced ImageMagick effects and options.

Code

function imagemagick_advanced_auto_orient_effect($image) {
  if (!image_toolkit_invoke('auto_orient', $image)) {
    watchdog('imagemagick', 'Image auto orient failed using the %toolkit toolkit on %path (%mimetype, %dimensions)', array(
      '%toolkit' => $image->toolkit,
      '%path' => $image->source,
      '%mimetype' => $image->info['mime_type'],
      '%dimensions' => $image->info['height'] . 'x' . $image->info['height'],
    ), WATCHDOG_ERROR);
    return FALSE;
  }
  return TRUE;
}