WP_Image_Editor_Imagick::flip
Flips current image.
Method of the class: WP_Image_Editor_Imagick{}
No Hooks.
Returns
true|WP_Error.
Usage
$WP_Image_Editor_Imagick = new WP_Image_Editor_Imagick(); $WP_Image_Editor_Imagick->flip( $horz, $vert );
- $horz(true|false) (required)
- Flip along Horizontal Axis.
- $vert(true|false) (required)
- Flip along Vertical Axis.
Changelog
| Since 3.5.0 | Introduced. |
WP_Image_Editor_Imagick::flip() WP Image Editor Imagick::flip code WP 6.9
public function flip( $horz, $vert ) {
try {
if ( $horz ) {
$this->image->flipImage();
}
if ( $vert ) {
$this->image->flopImage();
}
// Normalize EXIF orientation data so that display is consistent across devices.
if ( is_callable( array( $this->image, 'setImageOrientation' ) ) && defined( 'Imagick::ORIENTATION_TOPLEFT' ) ) {
$this->image->setImageOrientation( Imagick::ORIENTATION_TOPLEFT );
}
} catch ( Exception $e ) {
return new WP_Error( 'image_flip_error', $e->getMessage() );
}
return true;
}