public function getURL()
 {
     if (!$this->setImageLoaderURL) {
         $this->url = ImageLoader::cacheImage($this->url, $this->imageOptions);
         $this->setImageLoaderURL = true;
     }
     return parent::getURL();
 }
 /**
  * Get url.
  *
  * @return url.
  */
 public function getUrl()
 {
     if (!$this->setImageLoaderURL) {
         $this->url = ImageLoader::cacheImage($this->url, $this->isThumbnail() ? $this->thumbnailOptions : $this->imageOptions);
         $this->setImageLoaderURL = true;
     }
     return $this->url;
 }
 private function parseUser($entry)
 {
     $user = new TwitterUser();
     $user->setUserID($entry['id_str']);
     $user->setName('@' . $entry['screen_name']);
     $user->setImageURL(ImageLoader::cacheImage(IS_SECURE ? $entry['profile_image_url_https'] : $entry['profile_image_url'], array()));
     return $user;
 }
Exemple #4
0
 /**
  * Return an image stored in the current theme.
  * 
  * @param  string $image_name The name of the image to be loaded
  * 
  * @return Response a 200 with the image data if found, or a 404 if not found
  */
 public function getThemeImage($image_name)
 {
     try {
         $theme = \ThemeLoader::load();
         $image_location = $theme->imageLocation($image_name);
         $image = \ImageLoader::load($image_location);
         return response($image->data(), 200);
     } catch (ImageNotFoundException $e) {
         return response("image not found", 404);
     }
 }
 private function parseUser($entry)
 {
     $user = new FacebookUser();
     $user->setUserID($entry['id']);
     $user->setName($entry['name']);
     $user->setImageURL(ImageLoader::cacheImage('https://graph.facebook.com/' . $entry['id'] . '/picture?type=square', array()));
     return $user;
 }
Exemple #6
0
 /**
  * @expectedException \Ponup\GlLoaders\LoaderException
  * @expectedExceptionMessage File not found: wrong-file-path.foo
  */
 public function testExceptionIsThrownOnWrongPath()
 {
     $this->subject->load('wrong-file-path.foo', $width, $height);
 }
 public static function getImageLoaderURL($url, &$width, &$height) {
        if ($url && strpos($url, '/photo-placeholder.gif') !== FALSE) {
            $url = ''; // skip empty placeholder image 
        }
        
        if ($url) {
            switch ($GLOBALS['deviceClassifier']->getPagetype()) {
                case 'compliant':
                    $width = 140;
                    $height = 140;
                    break;
                case 'basic':
                case 'touch':
                default:
                    $width = 70;
                    $height = 70;
                    break;
            }
          
            $extension = pathinfo($url, PATHINFO_EXTENSION);
            if ($extension) { $extension = ".$extension"; }
  
            $url = ImageLoader::precache($url, $width, $height, 'LDAP_'.md5($url).$extension);
        }
        
        return $url;
    }