1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
Info.php
См. документацию.
1<?php
8
9namespace Bitrix\Main\File\Image;
10
11use Bitrix\Main\File\Image;
12
13class Info
14{
15 protected
21
25 public function getWidth()
26 {
27 return $this->width;
28 }
29
34 public function setWidth($width)
35 {
36 $this->width = $width;
37 return $this;
38 }
39
43 public function getHeight()
44 {
45 return $this->height;
46 }
47
52 public function setHeight($height)
53 {
54 $this->height = $height;
55 return $this;
56 }
57
61 public function getFormat()
62 {
63 return $this->format;
64 }
65
70 public function setFormat($format)
71 {
72 $this->format = $format;
73 return $this;
74 }
75
79 public function getAttributes()
80 {
81 return "width=\"{$this->getWidth()}\" height=\"{$this->getHeight()}\"";
82 }
83
87 public function getMime()
88 {
89 return $this->mime;
90 }
91
96 public function setMime($mime)
97 {
98 $this->mime = $mime;
99 return $this;
100 }
101
106 public function swapSides()
107 {
108 $tmp = $this->getHeight();
109 $this->setHeight($this->getWidth())
110 ->setWidth($tmp)
111 ;
112 return $this;
113 }
114
119 public function isSupported()
120 {
121 static $knownTypes = null;
122
123 if ($knownTypes === null)
124 {
125 $knownTypes = [
126 Image::FORMAT_PNG => 1,
127 Image::FORMAT_JPEG => 1,
128 Image::FORMAT_GIF => 1,
129 Image::FORMAT_BMP => 1,
130 ];
131 if (function_exists("imagecreatefromwebp"))
132 {
133 $knownTypes[Image::FORMAT_WEBP] = 1;
134 }
135 }
136
137 return isset($knownTypes[$this->getFormat()]);
138 }
139
144 public function toRectangle()
145 {
146 return new Rectangle($this->getWidth(), $this->getHeight());
147 }
148}
setMime($mime)
Определения Info.php:96
isSupported()
Определения Info.php:119
setHeight($height)
Определения Info.php:52
swapSides()
Определения Info.php:106
getMime()
Определения Info.php:87
getHeight()
Определения Info.php:43
setFormat($format)
Определения Info.php:70
toRectangle()
Определения Info.php:144
setWidth($width)
Определения Info.php:34
$attributes
Определения Info.php:19
getFormat()
Определения Info.php:61
getWidth()
Определения Info.php:25
getAttributes()
Определения Info.php:79
if(!is_array($prop["VALUES"])) $tmp
Определения component_props.php:203
hidden PROPERTY[<?=$propertyIndex?>][CODE]<?=htmlspecialcharsEx( $propertyCode)?> height
Определения file_new.php:759
bx popup label bx width30 PAGE_NEW_MENU_NAME text width
Определения file_new.php:677