diff --git a/app/Models/Photo.php b/app/Models/Photo.php index f31ee38..fde84aa 100644 --- a/app/Models/Photo.php +++ b/app/Models/Photo.php @@ -158,10 +158,17 @@ class Photo extends Abstracted\Catalog && $this->Imagick_getImageProperty('exif:DateTime') === '0000:00:00 00:00:00') return NULL; - $result = Carbon::create($x= - ($this->Imagick_getImageProperty('exif:DateTimeOriginal') && ($this->Imagick_getImageProperty('exif:DateTimeOriginal') !== '0000:00:00 00:00:00')) - ? $this->Imagick_getImageProperty('exif:DateTimeOriginal').$this->Imagick_getImageProperty('exif:OffsetTimeOriginal') - : $this->Imagick_getImageProperty('exif:DateTime').$this->Imagick_getImageProperty('exif:OffsetTime')); + try { + $result = Carbon::create( + ($this->Imagick_getImageProperty('exif:DateTimeOriginal') && ($this->Imagick_getImageProperty('exif:DateTimeOriginal') !== '0000:00:00 00:00:00')) + ? $this->Imagick_getImageProperty('exif:DateTimeOriginal').$this->Imagick_getImageProperty('exif:OffsetTimeOriginal') + : $this->Imagick_getImageProperty('exif:DateTime').$this->Imagick_getImageProperty('exif:OffsetTime')); + + } catch (\Exception $e) { + Log::alert(sprintf('We got exception [%s] when finding the create date',$e->getMessage())); + + return NULL; + } return $result ?: NULL;