function flopImage($image_path) { $imagick = new \Imagick(realpath($image_path)); $imagick->flopImage(); header("Content-Type: image/jpeg"); echo $imagick->getImageBlob(); }