mirror of
https://github.com/snipe/snipe-it.git
synced 2024-12-25 13:44:06 -08:00
Add orientate to image upload
Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
parent
d965fe759a
commit
3b948c7b7e
|
@ -109,10 +109,11 @@ class ImageUploadRequest extends Request
|
||||||
\Log::debug('Trying to upload to: '.$path.'/'.$file_name);
|
\Log::debug('Trying to upload to: '.$path.'/'.$file_name);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$upload = Image::make($image->getRealPath())->resize(null, $w, function ($constraint) {
|
$upload = Image::make($image->getRealPath())->setFileInfoFromPath($image->getRealPath())->resize(null, $w, function ($constraint) {
|
||||||
$constraint->aspectRatio();
|
$constraint->aspectRatio();
|
||||||
$constraint->upsize();
|
$constraint->upsize();
|
||||||
});
|
})->orientate();
|
||||||
|
|
||||||
} catch(NotReadableException $e) {
|
} catch(NotReadableException $e) {
|
||||||
\Log::debug($e);
|
\Log::debug($e);
|
||||||
$validator = \Validator::make([], []);
|
$validator = \Validator::make([], []);
|
||||||
|
@ -138,10 +139,8 @@ class ImageUploadRequest extends Request
|
||||||
$cleanSVG = $sanitizer->sanitize($dirtySVG);
|
$cleanSVG = $sanitizer->sanitize($dirtySVG);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
\Log::debug('Trying to upload to: '.$path.'/'.$file_name);
|
|
||||||
Storage::disk('public')->put($path.'/'.$file_name, $cleanSVG);
|
Storage::disk('public')->put($path.'/'.$file_name, $cleanSVG);
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
\Log::debug('Upload no workie :( ');
|
|
||||||
\Log::debug($e);
|
\Log::debug($e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue