Fallback to upload time first
parent
56fee51f1c
commit
b8e5901aaf
|
@ -14,7 +14,7 @@ class Util {
|
|||
$this->connection = $connection;
|
||||
}
|
||||
|
||||
public static function getDateTaken($file) {
|
||||
public static function getDateTaken(File $file) {
|
||||
// Attempt to read exif data
|
||||
if (in_array($file->getMimeType(), Application::IMAGE_MIMES)) {
|
||||
$exif = exif_read_data($file->fopen('rb'));
|
||||
|
@ -30,6 +30,11 @@ class Util {
|
|||
// Fall back to creation time
|
||||
$dateTaken = $file->getCreationTime();
|
||||
|
||||
// Fall back to upload time
|
||||
if ($dateTaken == 0) {
|
||||
$dateTaken = $file->getUploadTime();
|
||||
}
|
||||
|
||||
// Fall back to modification time
|
||||
if ($dateTaken == 0) {
|
||||
$dateTaken = $file->getMtime();
|
||||
|
|
Loading…
Reference in New Issue