/**
  * Return the properties of a tiled file.
  *
  * @return array|null
  * @see UniversalViewer_View_Helper_IiifManifest::_getTileProperties()
  */
 protected function _getTileProperties($file)
 {
     $olz = new OpenLayersZoom_Creator();
     $dirpath = $olz->useIIPImageServer() ? $olz->getZDataWeb($file) : $olz->getZDataDir($file);
     $properties = simplexml_load_file($dirpath . '/ImageProperties.xml');
     if ($properties === false) {
         return;
     }
     $properties = $properties->attributes();
     $properties = reset($properties);
     // Standardize the properties.
     $result = array();
     $result['size'] = (int) $properties['TILESIZE'];
     $result['total'] = (int) $properties['NUMTILES'];
     $result['source']['width'] = (int) $properties['WIDTH'];
     $result['source']['height'] = (int) $properties['HEIGHT'];
     return $result;
 }
 /**
  * Manages deletion of the folder of a file when this file is removed.
  */
 public function hookBeforeDeleteFile($args)
 {
     $file = $args['record'];
     $item = $file->getItem();
     $creator = new OpenLayersZoom_Creator();
     $creator->removeZDataDir($file);
 }