Signed-off-by: Louis Chemineau <louis@chmn.me>
return extension_loaded('exif');
}
- /** @return array{'gps': FileMetadata, 'size': FileMetadata} */
+ /** @return array{'gps'?: FileMetadata, 'size'?: FileMetadata} */
public function execute(File $file): array {
$exifData = [];
$fileDescriptor = $file->fopen('rb');
+ if ($fileDescriptor === false) {
+ return [];
+ }
+
$data = null;
try {
// Needed to make reading exif data reliable.
}
public static function getMimetypesSupported(): string {
- return '/image\/.*/';
+ return '/image\/(png|jpeg|heif|webp|tiff)/';
}
/**