diff --git a/i18n/en.json b/i18n/en.json index 06dd8b7..13a4e8c 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -2,5 +2,6 @@ "exif-glmv-meshes": "Number of meshes", "exif-glmv-textures": "Number of textures", "exif-glmv-version": "GLTF version", - "exif-glmv-generator": "Model generator" + "exif-glmv-generator": "Model generator", + "exif-glmv-metadata": "GLMV metadata version" } \ No newline at end of file diff --git a/includes/GlModelHandler.php b/includes/GlModelHandler.php index ebc1096..6243498 100644 --- a/includes/GlModelHandler.php +++ b/includes/GlModelHandler.php @@ -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 *