mirror of
https://github.com/nextcloud/server.git
synced 2026-04-15 22:11:17 -04:00
Restrict EXIF extracting to a subset of formats
Signed-off-by: Louis Chemineau <louis@chmn.me>
This commit is contained in:
parent
157be42a83
commit
b67e34f78f
1 changed files with 6 additions and 2 deletions
|
|
@ -44,11 +44,15 @@ class ExifProvider implements IMetadataProvider {
|
|||
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.
|
||||
|
|
@ -107,7 +111,7 @@ class ExifProvider implements IMetadataProvider {
|
|||
}
|
||||
|
||||
public static function getMimetypesSupported(): string {
|
||||
return '/image\/.*/';
|
||||
return '/image\/(png|jpeg|heif|webp|tiff)/';
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in a new issue