Fix for photos with no exif:DateTime

This commit is contained in:
Deon George 2019-11-15 23:39:20 +11:00
parent 008e5eacc0
commit 6a17fd3716

View File

@ -140,11 +140,22 @@ class Photo extends Abstracted\Catalog
switch ($property) switch ($property)
{ {
case 'creationdate': return strtotime($this->property('exif:DateTimeOriginal') ? $this->property('exif:DateTimeOriginal') : $this->property('exif:DateTime')); break; case 'creationdate':
case 'height': return $this->_o->getImageHeight(); break; if ($this->property('exif:DateTimeOriginal') == '0000:00:00 00:00:00'
case 'orientation': return $this->_o->getImageOrientation(); break; && $this->property('exif:DateTimeOriginal') == '0000:00:00 00:00:00')
case 'signature': return $this->_o->getImageSignature(); break; return NULL;
case 'width': return $this->_o->getImageWidth(); break;
return strtotime(
$this->property('exif:DateTimeOriginal') && $this->property('exif:DateTimeOriginal') != '0000:00:00 00:00:00'
? $this->property('exif:DateTimeOriginal')
: $this->property('exif:DateTime'));
break;
case 'height': return $this->_o->getImageHeight();
case 'orientation': return $this->_o->getImageOrientation();
case 'signature': return $this->_o->getImageSignature();
case 'width': return $this->_o->getImageWidth();
default: default:
return $this->_o->getImageProperty($property); return $this->_o->getImageProperty($property);
} }
@ -157,8 +168,7 @@ class Photo extends Abstracted\Catalog
public function setDateCreated() public function setDateCreated()
{ {
if ($this->property('creationdate')) $this->date_created = $this->property('creationdate');
$this->date_created = $this->property('creationdate');
} }
public function setLocation() public function setLocation()