Merge pull request #14213 from snipe/fixes/orientate_on_exif

Fixed FD-40296 - mobile uploads sometimes uploading with incorrect orientation
This commit is contained in:
snipe 2024-02-05 16:22:03 +00:00 committed by GitHub
commit f52b00256d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -109,10 +109,11 @@ class ImageUploadRequest extends Request
\Log::debug('Trying to upload to: '.$path.'/'.$file_name);
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->upsize();
});
})->orientate();
} catch(NotReadableException $e) {
\Log::debug($e);
$validator = \Validator::make([], []);
@ -138,10 +139,8 @@ class ImageUploadRequest extends Request
$cleanSVG = $sanitizer->sanitize($dirtySVG);
try {
\Log::debug('Trying to upload to: '.$path.'/'.$file_name);
Storage::disk('public')->put($path.'/'.$file_name, $cleanSVG);
} catch (\Exception $e) {
\Log::debug('Upload no workie :( ');
\Log::debug($e);
}
}