$image =
apply_filters_deprecated( 'image_edit_before_change', array
( $image,
$changes ), '3.5.0', 'wp_image_editor_before_change'
);
} foreach ( $changes as $operation ) { switch ( $operation->type
) { case 'rotate':
if ( 0 !=
$operation->angle
) { if ( $image instanceof WP_Image_Editor
) { $image->
rotate( $operation->angle
);
} else { $image =
_rotate_image_resource( $image,
$operation->angle
);
} } break;
case 'flip':
if ( 0 !=
$operation->axis
) { if ( $image instanceof WP_Image_Editor
) { $image->
flip( ( $operation->axis & 1
) != 0,
( $operation->axis & 2
) != 0
);
} else { $image =
_flip_image_resource( $image,
( $operation->axis & 1
) != 0,
( $operation->axis & 2
) != 0
);
} }