Classe: GalleryResourceBaseMetadataReader - X-Ref
\ingroup Gallery
acts as some kind of decorator adding getter methods for getting
some information straight from the metadata field of the resource object,
without having to overload the basic GalleryResource object with thousands
of accessor methods for every single property we might need.
Using this method, we can have a ImageMetadataReader which would provide
methods like getHeight, getWidth, getBpp etc, and another SoundMetadataReader
with methods like getFrequency, etc.
The right way to use this class is:
<pre>
$reader = $resource->getResourceMetadataReader();
if( $resource->isImage()) {
print( "image size: ".$reader->getHeight()."x".$reader->getWidth()." pixels" );
}
</pre>
The method GalleryResource::getResourceMetadataReader() will return the right
metadata reader class so that we can check the properties of the file. We can either query
the methods GalleryResource::isImage(), GalleryResource::isVideo(), etc to know which properties
we can check, or use PHP's function for checking of which type a class is.