Skip to content

Commit

Permalink
Merge pull request #331 from peterrehm/master
Browse files Browse the repository at this point in the history
GridFSLoader Bug
  • Loading branch information
havvg committed Feb 20, 2014
2 parents 8581ab7 + 58f7b66 commit ac67948
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions Imagine/Data/Loader/GridFSLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,12 @@ public function find($id)
{
$image = $this->dm
->getRepository($this->class)
->findAll()
->getCollection()
->findOne(array("_id" => new \MongoId($id)));
->find(new \MongoId($id));

if (!$image) {
throw new NotFoundHttpException(sprintf('Source image not found with id "%s"', $id));
}

return $this->imagine->load($image['file']->getBytes());
return $this->imagine->load($image->getFile()->getBytes());
}
}

0 comments on commit ac67948

Please sign in to comment.