File indexing completed on 2025-01-26 05:29:14

0001 <?php
0002 
0003 namespace Intervention\Image\Imagick\Commands;
0004 
0005 class FlipCommand extends \Intervention\Image\Commands\AbstractCommand
0006 {
0007     /**
0008      * Mirrors an image
0009      *
0010      * @param  \Intervention\Image\Image $image
0011      * @return boolean
0012      */
0013     public function execute($image)
0014     {
0015         $mode = $this->argument(0)->value('h');
0016 
0017         if (in_array(strtolower($mode), [2, 'v', 'vert', 'vertical'])) {
0018             // flip vertical
0019             return $image->getCore()->flipImage();
0020         } else {
0021             // flip horizontal
0022             return $image->getCore()->flopImage();
0023         }
0024     }
0025 }