vladislavkopilov

PHP OOP

Jul 17th, 2015
295
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.62 KB | None | 0 0
  1. /**
  2.      * Resize
  3.      *
  4.      * @param array
  5.      * @param integer
  6.      * @param integer
  7.      * @return array
  8.      */
  9.     static function Resize($pictures, $width, $height, $proportional = false)
  10.     {
  11.         foreach ($pictures as $picture)
  12.         {
  13.             if(count($picture) > 0 && $picture !== NULL && $picture !== false)
  14.             {
  15.                 $type = ($proportional)? BX_RESIZE_IMAGE_PROPORTIONAL_ALT : BX_RESIZE_IMAGE_EXACT;
  16.                 $return = CFile::ResizeImageGet(
  17.                     $picture,
  18.                     array(
  19.                         "width" => intval($width),
  20.                         "height" => intval($height)
  21.                     ),
  22.                     $type,
  23.                     true
  24.                 );
  25.  
  26.                 break;
  27.             }
  28.         }
  29.  
  30.         return self::ArKeyUpper($return);
  31.     }
Advertisement
Add Comment
Please, Sign In to add comment