| 54 | | $this->size = @getimagesize(PHPWG_ROOT_PATH.$this->rel_path); |
| 55 | | } |
| 56 | | |
| 57 | | if (!$this->size && isset($infos['width']) && isset($infos['height'])) |
| 58 | | { |
| 59 | | $width = $infos['width']; |
| 60 | | $height = $infos['height']; |
| 61 | | |
| 62 | | $this->rotation = intval($infos['rotation']) % 4; |
| 63 | | // 1 or 5 => 90 clockwise |
| 64 | | // 3 or 7 => 270 clockwise |
| 65 | | if ($this->rotation % 2) |
| 66 | | { |
| 67 | | $width = $infos['height']; |
| 68 | | $height = $infos['width']; |
| 69 | | } |
| 70 | | |
| 71 | | $this->size = array($width, $height); |
| | 55 | if ( ($size=@getimagesize(PHPWG_ROOT_PATH.$this->rel_path)) === false) |
| | 56 | { |
| | 57 | $this->rel_path = get_themeconf('mime_icon_dir').'unknown.png'; |
| | 58 | $size = getimagesize(PHPWG_ROOT_PATH.$this->rel_path); |
| | 59 | } |
| | 60 | $this->size = array($size[0],$size[1]); |
| | 61 | } |
| | 62 | |
| | 63 | if (!$this->size) |
| | 64 | { |
| | 65 | if (isset($infos['width']) && isset($infos['height'])) |
| | 66 | { |
| | 67 | $width = $infos['width']; |
| | 68 | $height = $infos['height']; |
| | 69 | |
| | 70 | $this->rotation = intval($infos['rotation']) % 4; |
| | 71 | // 1 or 5 => 90 clockwise |
| | 72 | // 3 or 7 => 270 clockwise |
| | 73 | if ($this->rotation % 2) |
| | 74 | { |
| | 75 | $width = $infos['height']; |
| | 76 | $height = $infos['width']; |
| | 77 | } |
| | 78 | |
| | 79 | $this->size = array($width, $height); |
| | 80 | } |
| | 81 | elseif (!array_key_exists('width', $infos)) |
| | 82 | { |
| | 83 | $this->flags |= self::DIM_NOT_GIVEN; |
| | 84 | } |