Ejemplo n.º 1
0
 protected function formatSizes($sizes)
 {
     $result = array();
     foreach ($sizes as $size) {
         $size_info = photosPhoto::parseSize((string) $size);
         $type = $size_info['type'];
         $width = $size_info['width'];
         $height = $size_info['height'];
         if ($type == 'max' || $type == 'crop' || $type == 'width') {
             $result[] = array($type => $width);
         } else {
             if ($type == 'height') {
                 $result[] = array($type => $height);
             } elseif ($type == 'rectangle') {
                 $result[] = array('rectangle' => array($width, $height));
             }
         }
     }
     return $result;
 }
Ejemplo n.º 2
0
 public static function getThumbInfo($photo, $size)
 {
     $size_info = photosPhoto::parseSize($size);
     return array('size' => photosPhoto::getRealSizesOfThumb($photo, $size_info), 'url' => photosPhoto::getPhotoUrl($photo, $size, true), 'bound' => array('width' => $size_info['width'], 'height' => $size_info['height']));
 }
 public static function getThumbInfo($photo, $size, $absolute = true)
 {
     $size_info = photosPhoto::parseSize($size);
     return array('size' => photosPhoto::getRealSizesOfThumb($photo, $size_info), 'url' => photosPhoto::getPhotoUrl($photo, $size, $absolute, wa('photos')->getConfig()->getCDN()), 'bound' => array('width' => $size_info['width'], 'height' => $size_info['height']));
 }