Exemplo n.º 1
0
 /**
  * @param File|FSFile $file
  * @param string $path Unused
  * @param bool|array $metadata
  * @return array
  */
 function getImageSize($file, $path, $metadata = false)
 {
     if ($metadata === false && $file instanceof File) {
         $metadata = $file->getMetadata();
     }
     $metadata = $this->unpackMetadata($metadata);
     if (isset($metadata['width']) && isset($metadata['height'])) {
         return [$metadata['width'], $metadata['height'], 'SVG', "width=\"{$metadata['width']}\" height=\"{$metadata['height']}\""];
     } else {
         // error
         return [0, 0, 'SVG', "width=\"0\" height=\"0\""];
     }
 }