// and if there is an error, show the error message
if (!$image->flip_horizontal()) {
show_error($image->error, $image->source_path, $image->target_path);
}
// indicate a target image
$image->target_path = 'results/flip-v.' . $ext;
// flip vertically
// and if there is an error, show the error message
if (!$image->flip_vertical()) {
show_error($image->error, $image->source_path, $image->target_path);
}
// indicate a target image
$image->target_path = 'results/flip-b.' . $ext;
// flip both horizontally and vertically
// and if there is an error, show the error message
if (!$image->flip_both()) {
show_error($image->error, $image->source_path, $image->target_path);
}
// indicate a target image
$image->target_path = 'results/crop.' . $ext;
// crop
// and if there is an error, show the error message
if (!$image->crop(0, 0, 50, 50)) {
show_error($image->error, $image->source_path, $image->target_path);
}
// indicate a target image
$image->target_path = 'results/rotate.' . $ext;
// rotate
// and if there is an error, show the error message
if (!$image->rotate(45)) {
show_error($image->error, $image->source_path, $image->target_path);