diff options
Diffstat (limited to 'lib/private/Metadata')
-rw-r--r-- | lib/private/Metadata/MetadataManager.php | 7 | ||||
-rw-r--r-- | lib/private/Metadata/Provider/ExifProvider.php | 8 |
2 files changed, 14 insertions, 1 deletions
diff --git a/lib/private/Metadata/MetadataManager.php b/lib/private/Metadata/MetadataManager.php index 69e9cb3c852..d1cb896febf 100644 --- a/lib/private/Metadata/MetadataManager.php +++ b/lib/private/Metadata/MetadataManager.php @@ -93,7 +93,12 @@ class MetadataManager implements IMetadataManager { public function getCapabilities(): array { $capabilities = []; foreach ($this->providers as $supportedMimetype => $provider) { - $capabilities[$supportedMimetype] = $provider::groupsProvided(); + foreach ($provider::groupsProvided() as $group) { + if (isset($capabilities[$group])) { + $capabilities[$group][] = $supportedMimetype; + } + $capabilities[$group] = [$supportedMimetype]; + } } return $capabilities; } diff --git a/lib/private/Metadata/Provider/ExifProvider.php b/lib/private/Metadata/Provider/ExifProvider.php index 91c858f6794..2e1eb1d4208 100644 --- a/lib/private/Metadata/Provider/ExifProvider.php +++ b/lib/private/Metadata/Provider/ExifProvider.php @@ -25,6 +25,14 @@ class ExifProvider implements IMetadataProvider { $size->setMetadata([]); if (!$data) { + $sizeResult = getimagesizefromstring($file->getContent()); + if ($sizeResult !== false) { + $size->setMetadata([ + 'width' => $sizeResult[0], + 'height' => $sizeResult[1], + ]); + } + return [ 'size' => $size, ]; |