Display metadata on file page

Signed-off-by: Justin Georgi <justin.georgi@gmail.com>
This commit is contained in:
2024-11-11 20:55:07 -07:00
parent 9e1f89b92b
commit d559e786d1
2 changed files with 23 additions and 2 deletions

View File

@@ -198,7 +198,7 @@ class GlModelHandler extends ImageHandler {
}
$newMeta['glmv-metadata'] = self::GLMV_VERSION;
$metaHandler = new BitmapMetadataHandler;
$metaHandler->addMetadata($newMeta,'exif');
$metaHandler->addMetadata($newMeta,'native');
return array(
'width' => 600,
'height' => 800,
@@ -225,6 +225,26 @@ class GlModelHandler extends ImageHandler {
return self::METADATA_GOOD;
}
/**
* Get an array structure that the UI will format this into a table where the visible
* fields are always visible, and the collapsed fields are optionally visible.
*
* The function should return false if there is no metadata to display.
*
* @param File $image
* @param bool|IContextSource $context Context to use (optional)
* @return bool|array
*/
public function formatMetadata( $image, $context = false ) {
$glmvMetadata = $image->getMetadataArray();
if (!count( $glmvMetadata ) ) {
return false;
} else {
return $this->formatMetadataHelper( $glmvMetadata, $context );
}
}
/**
* Small helper function to display information on the browser console
*