Skip to content

Commit

Permalink
Fix photo issue without complete exif datas
Browse files Browse the repository at this point in the history
  • Loading branch information
bierdok committed Mar 17, 2019
1 parent e7d1793 commit bc4f7ec
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Controller/DefaultController.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,10 @@ public function index(Request $request)
if (!$data = @exif_read_data($file->getRealPath())) {
continue;
}
$time = new \DateTime($data['DateTimeOriginal']);
$time = new \DateTime(sprintf('@%d', $data['FileDateTime']));
if (isset($data['DateTimeOriginal'])) {
$time = new \DateTime($data['DateTimeOriginal']);
}
$galleries[$time->format('Y-m')][$time->getTimestamp() . $x] = [
'name' => $file->getFilename(),
'time' => $time->getTimestamp(),
Expand Down

0 comments on commit bc4f7ec

Please sign in to comment.