當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Imagick::flipImage方法代碼示例

本文整理匯總了PHP中Imagick::flipImage方法的典型用法代碼示例。如果您正苦於以下問題:PHP Imagick::flipImage方法的具體用法?PHP Imagick::flipImage怎麽用?PHP Imagick::flipImage使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Imagick的用法示例。


在下文中一共展示了Imagick::flipImage方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: flip

 /**
  * Flip the current image.
  */
 public function flip()
 {
     try {
         $this->_imagick->flipImage();
     } catch (ImagickException $e) {
         throw new Horde_Image_Exception($e);
     }
 }
開發者ID:jubinpatel,項目名稱:horde,代碼行數:11,代碼來源:Imagick.php

示例2: flip

 /**
  * Vertical mirroring
  *
  * @return bool|PEAR_Error TRUE or a PEAR_Error object on error
  * @access public
  */
 function flip()
 {
     try {
         $this->imagick->flipImage();
     } catch (ImagickException $e) {
         return $this->raiseError('Could not flip the image.', IMAGE_TRANSFORM_ERROR_FAILED);
     }
     return true;
 }
開發者ID:rivetweb,項目名稱:old-book-with-active-areas,代碼行數:15,代碼來源:Imagick3.php

示例3: flipVertically

 /**
  * {@inheritdoc}
  *
  * @return ImageInterface
  */
 public function flipVertically()
 {
     try {
         $this->imagick->flipImage();
     } catch (\ImagickException $e) {
         throw new RuntimeException('Vertical flip operation failed', $e->getCode(), $e);
     }
     return $this;
 }
開發者ID:scisahaha,項目名稱:generator-craft,代碼行數:14,代碼來源:Image.php

示例4: flip

 /**
  * {@inheritdoc}
  */
 public function flip($direction = Image::FLIP_HORIZONTAL)
 {
     if ($direction === Image::FLIP_VERTICAL) {
         // Flips the image in the vertical direction
         $this->image->flipImage();
     } else {
         // Flips the image in the horizontal direction
         $this->image->flopImage();
     }
 }
開發者ID:muhammetardayildiz,項目名稱:framework,代碼行數:13,代碼來源:ImageMagick.php

示例5: flip

 public function flip($flipX = false, $flipY = false)
 {
     if ($flipX) {
         $this->image->flopImage();
     }
     if ($flipY) {
         $this->image->flipImage();
     }
     return $this;
 }
開發者ID:phpixie,項目名稱:image,代碼行數:10,代碼來源:Resource.php

示例6: mirror

 /**
  * @param $mode
  * @return $this|Adapter
  */
 public function mirror($mode)
 {
     $this->preModify();
     if ($mode == "vertical") {
         $this->resource->flipImage();
     } elseif ($mode == "horizontal") {
         $this->resource->flopImage();
     }
     $this->postModify();
     return $this;
 }
開發者ID:emanuel-london,項目名稱:pimcore,代碼行數:15,代碼來源:Imagick.php

示例7: flip

	/**
	 * Flips current image.
	 *
	 * @since 3.5.0
	 * @access public
	 *
	 * @param boolean $horz Flip along Horizontal Axis
	 * @param boolean $vert Flip along Vertical Axis
	 * @returns true|WP_Error
	 */
	public function flip( $horz, $vert ) {
		try {
			if ( $horz )
				$this->image->flipImage();

			if ( $vert )
				$this->image->flopImage();
		}
		catch ( Exception $e ) {
			return new WP_Error( 'image_flip_error', $e->getMessage() );
		}
		return true;
	}
開發者ID:ShankarVellal,項目名稱:WordPress,代碼行數:23,代碼來源:class-wp-image-editor-imagick.php

示例8: flip

 public function flip($horizontal = true)
 {
     // Flip
     try {
         if ($horizontal) {
             $return = $this->_resource->flopImage();
         } else {
             $return = $this->_resource->flipImage();
         }
     } catch (ImagickException $e) {
         throw new Engine_Image_Adapter_Exception(sprintf('Unable to flip image: %s', $e->getMessage()), $e->getCode());
     }
     return $this;
 }
開發者ID:febryantosulistyo,項目名稱:ClassicSocial,代碼行數:14,代碼來源:Imagick.php

示例9: flip

 public function flip($newFile, $mode)
 {
     $imagick = new Imagick();
     $imagick->readImage($this->_file);
     switch ($mode) {
         case Tomato_Image_Abstract::FLIP_VERTICAL:
             $imagick->flipImage();
             break;
         case Tomato_Image_Abstract::FLIP_HORIZONTAL:
             $imagick->flopImage();
             break;
     }
     $imagick->writeImage($newFile);
     $imagick->clear();
     $imagick->destroy();
 }
開發者ID:piratevn,項目名稱:cms-gio,代碼行數:16,代碼來源:ImageMagick.php

示例10: process

 public function process(\Imagick $image)
 {
     $info = getimagesize($this->_file);
     if ($info['mime'] != 'image/jpeg') {
         return $image;
     }
     if (!($exif_data = exif_read_data($this->_file))) {
         return $image;
     }
     if (isset($exif_data['Orientation'])) {
         $ort = $exif_data['Orientation'];
         if ($ort > 1) {
             switch ($ort) {
                 case 2:
                     $image->flopImage();
                     break;
                 case 3:
                     $image->rotateImage(new \ImagickPixel(), 180);
                     break;
                 case 4:
                     $image->flipImage();
                     break;
                 case 5:
                     $image->flopImage();
                     $image->rotateImage(new \ImagickPixel(), 270);
                     break;
                 case 6:
                     $image->rotateImage(new \ImagickPixel(), 90);
                     break;
                 case 7:
                     $image->flopImage();
                     $image->rotateImage(new \ImagickPixel(), 90);
                     break;
                 case 8:
                     $image->rotateImage(new \ImagickPixel(), 270);
                     break;
             }
         }
     }
     return $image;
 }
開發者ID:romainbureau,項目名稱:Custom,代碼行數:41,代碼來源:FixOrientation.php

示例11: flip

 public function flip($flip_x = false, $flip_y = false)
 {
     if ($flip_x) {
         if ($this->multiframe()) {
             foreach ($this->image as $frame) {
                 $frame->flopImage();
             }
         } else {
             $this->image->flopImage();
         }
     }
     if ($flip_y) {
         if ($this->multiframe()) {
             foreach ($this->image as $frame) {
                 $frame->flipImage();
             }
         } else {
             $this->image->flipImage();
         }
     }
     return $this;
 }
開發者ID:anp135,項目名稱:altocms,代碼行數:22,代碼來源:Imagick.php

示例12: uniqid

 } else {
     print "Possible file upload attack!\n";
 }
 $s3 = new Aws\S3\S3Client(['version' => 'latest', 'region' => 'us-east-1']);
 $bucket = uniqid("S3-Sukanya-", false);
 //print "Creating bucket named {$bucket}\n";
 $result = $s3->createBucket(['ACL' => 'public-read', 'Bucket' => $bucket]);
 $result = $s3->waitUntil('BucketExists', array('Bucket' => $bucket));
 //echo "bucket creation done";
 $result = $s3->putObject(['ACL' => 'public-read', 'Bucket' => $bucket, 'Key' => "uploads" . $uploadfile, 'ContentType' => $_FILES['userfile']['type'], 'Body' => fopen($uploadfile, 'r+')]);
 $url = $result['ObjectURL'];
 //adding expiration to bucket
 $objectrule = $s3->putBucketLifecycleConfiguration(['Bucket' => $bucket, 'LifecycleConfiguration' => ['Rules' => [['Expiration' => ['Days' => 1], 'NoncurrentVersionExpiration' => ['NoncurrentDays' => 1], 'Prefix' => ' ', 'Status' => 'Enabled']]]]);
 // reference http://php.net/manual/en/imagick.writeimage.php
 $filepath = new Imagick($uploadfile);
 $filepath->flipImage();
 mkdir("/tmp/Imagick");
 $extension = end(explode('.', $filename));
 echo "extension here";
 echo $extension;
 $path = '/tmp/Imagick/';
 $imgid = uniqid("DesImage");
 $imgloc = $imgid . '.' . $extension;
 $DestPath = $path . $imgloc;
 echo $DestPath;
 ///tmp/Imagick/DesImage56553cb459719.png
 //$filepath->setImageFormat ("png");
 //file_put_contents ($DestPath, $filepath);
 $filepath->writeImage($DestPath);
 //bucket creation of flip image
 $flipbucket = uniqid("flippedimage", false);
開發者ID:sukanyaN,項目名稱:itmo-544-final,代碼行數:31,代碼來源:submit.php

示例13: correctOrientation

 /**
  * Corrects orientation of an image
  * @param \Imagick $im
  */
 private function correctOrientation(\Imagick &$im)
 {
     switch ($im->getImageOrientation()) {
         case \Imagick::ORIENTATION_TOPRIGHT:
             $im->flipImage();
             break;
         case \Imagick::ORIENTATION_BOTTOMRIGHT:
             $im->rotateImage(new \ImagickPixel("none"), 180);
             break;
         case \Imagick::ORIENTATION_BOTTOMLEFT:
             $im->rotateImage(new \ImagickPixel("none"), 180);
             $im->flipImage();
             break;
         case \Imagick::ORIENTATION_LEFTTOP:
             $im->rotateImage(new \ImagickPixel("none"), 90);
             $im->flipImage();
             break;
         case \Imagick::ORIENTATION_RIGHTTOP:
             $im->rotateImage(new \ImagickPixel("none"), 90);
             break;
         case \Imagick::ORIENTATION_RIGHTBOTTOM:
             $im->rotateImage(new \ImagickPixel("none"), -90);
             $im->flipImage();
             break;
         case \Imagick::ORIENTATION_LEFTBOTTOM:
             $im->rotateImage(new \ImagickPixel("none"), -90);
             break;
         default:
     }
 }
開發者ID:myurasov,項目名稱:mym-mongodb-odm-tools,代碼行數:34,代碼來源:Image.php

示例14: flip

 /**
  * Applies a vertical mirror on the image
  *
  * @return Imagick
  */
 public function flip()
 {
     $this->image->flipImage();
     $this->operations[] = 'flip';
     return $this;
 }
開發者ID:pierrerolland,項目名稱:imagick-bundle,代碼行數:11,代碼來源:Imagick.php

示例15: _rotate

 /**
  * 水平翻轉(左右翻轉)或垂直翻轉(上下翻轉)
  * @param Imagick $im
  * @param string $hv
  * @return boolean
  */
 private function _rotate(&$im, $hv)
 {
     if (self::ROTATE_H == $hv) {
         // 水平翻轉
         $boolean = $im->flopImage();
     } elseif (self::ROTATE_V == $hv) {
         // 垂直翻轉
         $boolean = $im->flipImage();
     } else {
         $this->_error = '參數錯誤';
         $this->_im = null;
         return false;
     }
     if ($boolean) {
         return true;
     } else {
         $this->_error = '翻轉失敗';
         $this->_im = null;
         return false;
     }
 }
開發者ID:OuHaixiong,項目名稱:img,代碼行數:27,代碼來源:Imagick.php


注:本文中的Imagick::flipImage方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。