public function testImageFileSystemPath() { $image = new Image(__DIR__ . '/img/test.jpg'); $this->assertNotEmpty($image->getBlob()); }
/** * @param $identifier * @return Image|null */ public function getImage($identifier) { $image = $this->getMongoCollection()->findOne([$this->getIdentifierName() => $identifier]); if ($image) { $imgContainer = new Image(); $imgContainer->setBlob($image['blob']->bin); $imgContainer->setSize(strlen($image['blob']->bin)); $imgContainer->setMimeType($this->detectBufferMimeType($image['blob']->bin)); return $imgContainer; } else { return null; } }