2 namespace TYPO3\CMS\Core\Type\File;
58 if (is_null($this->imageSizes)) {
59 $this->imageSizes = getimagesize($this->getPathname());
62 if ($this->imageSizes ===
false) {
67 if (empty($this->imageSizes) && $this->
getMimeType() ===
'image/svg+xml') {
72 if (empty($this->imageSizes)) {
73 $this->getLogger()->warning(
'I could not retrieve the image size for file ' . $this->getPathname());
74 $this->imageSizes = array(0, 0);
88 $imagesSizes = array();
90 $xml = simplexml_load_file($this->getPathname());
91 $xmlAttributes = $xml->attributes();
94 if (!empty($xmlAttributes[
'width']) && !empty($xmlAttributes[
'height'])) {
95 $imagesSizes = array((
int)$xmlAttributes[
'width'], (
int)$xmlAttributes[
'height']);
98 }
elseif (!empty($xmlAttributes[
'viewBox'])) {
99 $viewBox = explode(
' ', $xmlAttributes[
'viewBox']);
100 $imagesSizes = array((
int)$viewBox[2], (
int)$viewBox[3]);
103 return $imagesSizes !== array() ? $imagesSizes :
false;
109 protected function getLogger()
114 return $loggerManager->getLogger(get_class($this));
122 static $graphicalFunctions = null;
124 if ($graphicalFunctions === null) {
128 return $graphicalFunctions;