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

@@ -2,5 +2,6 @@
"exif-glmv-meshes": "Number of meshes", "exif-glmv-meshes": "Number of meshes",
"exif-glmv-textures": "Number of textures", "exif-glmv-textures": "Number of textures",
"exif-glmv-version": "GLTF version", "exif-glmv-version": "GLTF version",
"exif-glmv-generator": "Model generator" "exif-glmv-generator": "Model generator",
"exif-glmv-metadata": "GLMV metadata version"
} }

View File

@@ -198,7 +198,7 @@ class GlModelHandler extends ImageHandler {
} }
$newMeta['glmv-metadata'] = self::GLMV_VERSION; $newMeta['glmv-metadata'] = self::GLMV_VERSION;
$metaHandler = new BitmapMetadataHandler; $metaHandler = new BitmapMetadataHandler;
$metaHandler->addMetadata($newMeta,'exif'); $metaHandler->addMetadata($newMeta,'native');
return array( return array(
'width' => 600, 'width' => 600,
'height' => 800, 'height' => 800,
@@ -226,6 +226,26 @@ class GlModelHandler extends ImageHandler {
} }
/** /**
* 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 * Small helper function to display information on the browser console
* *
* Usage: * Usage: