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


PHP ImageInterface::strip方法代碼示例

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


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

示例1: apply

 /**
  * {@inheritdoc}
  */
 public function apply(ImageInterface $image)
 {
     return $image->strip();
 }
開發者ID:anillaogi016,項目名稱:zend-admin,代碼行數:7,代碼來源:Strip.php

示例2: autoOrient

 /**
  * Re-orient an image using its embedded Exif profile orientation:
  * 1. Read the embedded exif data inside the image to determine it's orientation.
  * 2. Rotate and flip the image accordingly to re-orient it.
  * 3. Strip the Exif data from the image so that there can be no attempt to 'correct' it again.
  *
  * @param  string $path
  * @param  ImageInterface $image
  * @return ImageInterface $image
  */
 protected function autoOrient($path, ImageInterface $image)
 {
     $exif = exif_read_data($path);
     if (isset($exif['Orientation'])) {
         switch ($exif['Orientation']) {
             case 2:
                 $image->flipHorizontally();
                 break;
             case 3:
                 $image->rotate(180);
                 break;
             case 4:
                 $image->flipVertically();
                 break;
             case 5:
                 $image->flipVertically()->rotate(90);
                 break;
             case 6:
                 $image->rotate(90);
                 break;
             case 7:
                 $image->flipHorizontally()->rotate(90);
                 break;
             case 8:
                 $image->rotate(-90);
                 break;
         }
     }
     return $image->strip();
 }
開發者ID:JoelFieldCodeProjects,項目名稱:test,代碼行數:40,代碼來源:Resizer.php

示例3: autoOrient

 /**
  * Re-orient an image using its embedded Exif profile orientation:
  * 1. Attempt to read the embedded exif data inside the image to determine it's orientation.
  *    if there is no exif data (i.e an exeption is thrown when trying to read it) then we'll
  *    just return the image as is.
  * 2. If there is exif data, we'll rotate and flip the image accordingly to re-orient it.
  * 3. Finally, we'll strip the exif data from the image so that there can be no attempt to 'correct' it again.
  *
  * @param string         $path
  * @param ImageInterface $image
  *
  * @return ImageInterface $image
  */
 protected function autoOrient($path, ImageInterface $image)
 {
     if (function_exists('exif_read_data')) {
         try {
             $exif = exif_read_data($path);
         } catch (ErrorException $e) {
             return $image;
         }
         if (isset($exif['Orientation'])) {
             switch ($exif['Orientation']) {
                 case 2:
                     $image->flipHorizontally();
                     break;
                 case 3:
                     $image->rotate(180);
                     break;
                 case 4:
                     $image->flipVertically();
                     break;
                 case 5:
                     $image->flipVertically()->rotate(90);
                     break;
                 case 6:
                     $image->rotate(90);
                     break;
                 case 7:
                     $image->flipHorizontally()->rotate(90);
                     break;
                 case 8:
                     $image->rotate(-90);
                     break;
             }
         }
         return $image->strip();
     } else {
         return $image;
     }
 }
開發者ID:laravelian,項目名稱:stapler,代碼行數:51,代碼來源:Resizer.php


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