Skip to content

Commit

Permalink
Merge pull request #75 from Qballinternet/bugfix/image-output
Browse files Browse the repository at this point in the history
Fixed image outputting
  • Loading branch information
weotch committed Feb 18, 2015
2 parents 1a59d3f + 8d4bcb0 commit 6949efa
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion src/Bkwld/Croppa/ServiceProviderLaravel4.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,10 @@ public function boot() {
// Listen for Cropa style URLs, these are how Croppa gets triggered
$croppa = $this->app['croppa'];
$this->app->make('router')->get('{path}', function($path) use ($croppa) {
$croppa->generate($path);
$image = $croppa->generate($path);
return \Response::stream(function() use ($image) {
return $image->show();
});
})->where('path', $croppa->directoryPattern());
}

Expand Down
5 changes: 4 additions & 1 deletion src/Bkwld/Croppa/ServiceProviderLaravel5.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,10 @@ public function boot() {
// Listen for Cropa style URLs, these are how Croppa gets triggered
$croppa = $this->app['croppa'];
$this->app->make('router')->get('{path}', function($path) use ($croppa) {
$croppa->generate($path);
$image = $croppa->generate($path);
return \Response::stream(function() use ($image) {
return $image->show();
});
})->where('path', $croppa->directoryPattern());
}
}

0 comments on commit 6949efa

Please sign in to comment.