ILIAS  trunk Revision v11.0_alpha-1715-g7fc467680fb
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ExifEngine.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
22 
26 class ExifEngine implements Engine
27 {
28  use PHPMemoryLimit;
29 
30  public function __construct()
31  {
32  }
33 
34  public function supports(string $suffix): bool
35  {
36  return true;
37  }
38 
39  public function isRunning(): bool
40  {
41  return extension_loaded('exif');
42  }
43 
44  public function read(string $file_path): array
45  {
46  try {
47  $exif = exif_read_data($file_path);
48  if ($exif === false) {
49  return [];
50  }
51  return $exif;
52  } catch (\Throwable $e) {
53  return [];
54  }
55  }
56 
57 }