Example #1
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);
     }
 }
Example #2
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);
 }