* * @param string $partialPath * @return string */ public function absPath(string $partialPath): string { return Path::join(Path::getProjectDir(), 'public', $partialPath); } /** * Return the src of an image as a base64 content * * Usage : * * * * @param File $file * @return string * @throws FileNotFoundException */ public function toBase64Src(File $file): string { return 'data:' . $file->getMimeType() . ';base64,' . base64_encode($this->imageManager->read($file)); } }