Skip to content

Commit 2a22db5

Browse files
committed
#438 Fix orientate() is not applied to uploaded image
1 parent 8a7dec5 commit 2a22db5

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/controllers/UploadController.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ private function proceedSingleUpload($file)
6767
event(new ImageIsUploading($new_file_path));
6868
try {
6969
if (parent::fileIsImage($file)) {
70+
// File is an image
7071
// Process & compress the image
7172
Image::make($file->getRealPath())
7273
->orientate() //Apply orientation from exif data
@@ -76,11 +77,12 @@ private function proceedSingleUpload($file)
7677
if (parent::imageShouldHaveThumb($file)) {
7778
$this->makeThumb($new_filename);
7879
}
80+
} else {
81+
// File is not an image
82+
// Create (move) the file
83+
File::move($file->getRealPath(), $new_file_path);
7984
}
80-
81-
// Create (move) the file
82-
chmod($file->getRealPath(), config('lfm.create_file_mode', 0644));
83-
File::move($file->getRealPath(), $new_file_path);
85+
chmod($new_file_path, config('lfm.create_file_mode', 0644));
8486
} catch (\Exception $e) {
8587
array_push($this->errors, parent::error('invalid'));
8688
// FIXME: Exception must be logged.

0 commit comments

Comments
 (0)