mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-10 21:22:58 +01:00
🐛 Fix logo upload, keep png alpha
This commit is contained in:
parent
ed3ba8020a
commit
0df7e59d89
@ -39,13 +39,16 @@ class UploadAvatar implements ShouldQueue
|
||||
{
|
||||
|
||||
//make dir
|
||||
Storage::makeDirectory('public/'.$this->directory, 0775);
|
||||
Storage::makeDirectory($this->directory, 0775);
|
||||
|
||||
$tmp_file = sha1(time()).'.png';
|
||||
|
||||
$file_png = imagepng(imagecreatefromstring(file_get_contents($this->file)), sys_get_temp_dir().'/'.$tmp_file);
|
||||
$im = imagecreatefromstring(file_get_contents($this->file));
|
||||
imagealphablending($im, false);
|
||||
imagesavealpha($im, true);
|
||||
$file_png = imagepng($im, sys_get_temp_dir().'/'.$tmp_file);
|
||||
|
||||
$path = Storage::putFile('public/'.$this->directory, new File(sys_get_temp_dir().'/'.$tmp_file));
|
||||
$path = Storage::putFile($this->directory, new File(sys_get_temp_dir().'/'.$tmp_file));
|
||||
|
||||
info($path);
|
||||
info($tmp_file);
|
||||
|
Loading…
Reference in New Issue
Block a user