mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-14 21:43:18 +00:00
allow svg logo and change gabari
This commit is contained in:
@@ -97,14 +97,18 @@ class appbox extends base
|
||||
|
||||
public function write_application_logo(Filesystem $filesystem, $blob)
|
||||
{
|
||||
$logo_path = $this->app['root.path'] . '/www/custom/minilogos/personalize_logo.png';
|
||||
$logo_path = $this->app['root.path'] . '/www/custom/minilogos/personalize_logo.';
|
||||
|
||||
$data = str_replace('data:image/png;base64,', '', $blob);
|
||||
$data = str_replace(' ', '+', $data);
|
||||
list($type, $imageData) = explode(';', $blob);
|
||||
list(,$extension) = explode('/',$type);
|
||||
list(,$imageData) = explode(',', $imageData);
|
||||
|
||||
$data = str_replace(' ', '+', $imageData);
|
||||
$data = base64_decode($data);
|
||||
$extension= ($extension=='svg+xml')?'svg':$extension;
|
||||
|
||||
try{
|
||||
$filesystem->dumpFile($logo_path, $data);
|
||||
$filesystem->dumpFile($logo_path.$extension, $data);
|
||||
}catch(\Exception $e){
|
||||
return $e->getMessage();
|
||||
}
|
||||
|
Reference in New Issue
Block a user