aboutsummaryrefslogtreecommitdiff
path: root/app/Http/Controllers/RoscoController.php
diff options
context:
space:
mode:
authorfloppydiskette <floppydisk@hyprcat.net>2025-01-16 19:54:20 +0000
committerfloppydiskette <floppydisk@hyprcat.net>2025-01-16 19:54:20 +0000
commit3821e58e1021f7f44ee0aa23cca88f1abb95dbdd (patch)
tree89e476e1350308c12a572080bdd6eb74d654231b /app/Http/Controllers/RoscoController.php
parentcebb14f59cb54b24861a9aef03b9fcbf57465967 (diff)
two of them
Diffstat (limited to 'app/Http/Controllers/RoscoController.php')
-rw-r--r--app/Http/Controllers/RoscoController.php48
1 files changed, 0 insertions, 48 deletions
diff --git a/app/Http/Controllers/RoscoController.php b/app/Http/Controllers/RoscoController.php
deleted file mode 100644
index 9986831..0000000
--- a/app/Http/Controllers/RoscoController.php
+++ /dev/null
@@ -1,48 +0,0 @@
-<?php
-
-namespace App\Http\Controllers;
-
-use Illuminate\Support\Facades\File;
-use Illuminate\View\View;
-
-class RoscoController extends Controller {
- public function getImages(): array {
- $images = [];
- foreach (File::glob(public_path('images/rosco').'/*') as $path) {
- $image_data = [];
- try {
- $exif = exif_read_data($path);
- } catch (Exception $ex) {
-
- }
- $image_data["path"] = str_replace(public_path(), '', $path);
- if (isset($exif)) {
- if (isset($exif["ImageDescription"])) {
- $image_data["description"] = $exif["ImageDescription"];
- }
- if (isset($exif["DateTime"])) {
- $image_data["date"] = strtotime($exif["DateTime"]);
- }
- }
- array_push($images, $image_data);
- }
-
- usort($images, function ($a, $b) {
- $dateA = $a['date'] ?? PHP_INT_MIN;
- $dateB = $b['date'] ?? PHP_INT_MIN;
- return $dateB <=> $dateA;
- });
-
- return $images;
- }
-
- /**
- * Shows the page
- * @return View
- */
- public function show(): View {
- return view('rosco', [
- 'images' => $this->getImages(),
- ]);
- }
-}