1C-Bitrix
25.700.0
Загрузка...
Поиск...
Не найдено
Info.php
См. документацию.
1
<?php
8
9
namespace
Bitrix\Main\File\Image;
10
11
use Bitrix\Main\File\Image;
12
13
class
Info
14
{
15
protected
16
$width
,
17
$height
,
18
$format
,
19
$attributes
,
20
$mime
;
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
}
Bitrix\Main\File\Image\Info
Определения
Info.php:14
Bitrix\Main\File\Image\Info\setMime
setMime($mime)
Определения
Info.php:96
Bitrix\Main\File\Image\Info\$format
$format
Определения
Info.php:18
Bitrix\Main\File\Image\Info\$height
$height
Определения
Info.php:17
Bitrix\Main\File\Image\Info\isSupported
isSupported()
Определения
Info.php:119
Bitrix\Main\File\Image\Info\setHeight
setHeight($height)
Определения
Info.php:52
Bitrix\Main\File\Image\Info\swapSides
swapSides()
Определения
Info.php:106
Bitrix\Main\File\Image\Info\$width
$width
Определения
Info.php:16
Bitrix\Main\File\Image\Info\getMime
getMime()
Определения
Info.php:87
Bitrix\Main\File\Image\Info\$mime
$mime
Определения
Info.php:20
Bitrix\Main\File\Image\Info\getHeight
getHeight()
Определения
Info.php:43
Bitrix\Main\File\Image\Info\setFormat
setFormat($format)
Определения
Info.php:70
Bitrix\Main\File\Image\Info\toRectangle
toRectangle()
Определения
Info.php:144
Bitrix\Main\File\Image\Info\setWidth
setWidth($width)
Определения
Info.php:34
Bitrix\Main\File\Image\Info\$attributes
$attributes
Определения
Info.php:19
Bitrix\Main\File\Image\Info\getFormat
getFormat()
Определения
Info.php:61
Bitrix\Main\File\Image\Info\getWidth
getWidth()
Определения
Info.php:25
Bitrix\Main\File\Image\Info\getAttributes
getAttributes()
Определения
Info.php:79
Bitrix\Main\File\Image\Rectangle
Определения
Rectangle.php:14
$tmp
if(!is_array($prop["VALUES"])) $tmp
Определения
component_props.php:203
height
hidden PROPERTY[<?=$propertyIndex?>][CODE]<?=htmlspecialcharsEx( $propertyCode)?> height
Определения
file_new.php:759
width
bx popup label bx width30 PAGE_NEW_MENU_NAME text width
Определения
file_new.php:677
bitrix
modules
main
lib
File
Image
Info.php
Создано системой
1.14.0