Skip to content

Commit f99f83f

Browse files
committed
Fix negative function, reported by @acarlosos on #426
1 parent 1108867 commit f99f83f

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/controllers/UploadController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ private function proceedSingleUpload($file)
5555

5656
event(new ImageIsUploading($new_file_path));
5757
try {
58-
if (parent::fileIsImage($file) && ! parent::imageShouldNotHaveThumb($file)) {
58+
if (parent::fileIsImage($file) && parent::imageShouldHaveThumb($file)) {
5959
Image::make($file->getRealPath())
6060
->orientate() //Apply orientation from exif data
6161
->save($new_file_path, 90);

src/traits/LfmHelpers.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,7 @@ public function objectPresenter($item)
456456

457457
$thumb_path = $this->getThumbPath($item_name);
458458
$file_path = $this->getCurrentPath($item_name);
459-
if ($this->imageShouldNotHaveThumb($file_path)) {
459+
if (! $this->imageShouldHaveThumb($file_path)) {
460460
$thumb_url = $this->getFileUrl($item_name) . '?timestamp=' . filemtime($file_path);
461461
} elseif (File::exists($thumb_path)) {
462462
$thumb_url = $this->getThumbUrl($item_name) . '?timestamp=' . filemtime($thumb_path);
@@ -527,15 +527,15 @@ public function fileIsImage($file)
527527
* @param mixed $file Real path of a file or instance of UploadedFile.
528528
* @return bool
529529
*/
530-
public function imageShouldNotHaveThumb($file)
530+
public function imageShouldHaveThumb($file)
531531
{
532532
if (! config('lfm.should_create_thumbnails')) {
533-
return true;
533+
return false;
534534
}
535535

536536
$mime_type = $this->getFileType($file);
537537

538-
return ! in_array($mime_type, config('lfm.raster_mimetypes'));
538+
return in_array($mime_type, config('lfm.raster_mimetypes'));
539539
}
540540

541541
/**

0 commit comments

Comments
 (0)