1C-Bitrix
25.700.0
Загрузка...
Поиск...
Не найдено
resizedimage.php
См. документацию.
1
<?php
2
3
namespace
Bitrix\Main\Engine\Response;
4
5
6
use Bitrix\Main;
7
8
class
ResizedImage
extends
BFile
9
{
10
protected
$showInline
=
true
;
11
protected
$width
;
12
protected
$height
;
13
protected
$resizeType
=
BX_RESIZE_IMAGE_EXACT
;
14
protected
$filters
;
15
16
public
function
__construct
(
array
$file
,
$width
,
$height
,
$name
=
null
)
17
{
18
parent::__construct(
$file
,
$name
);
19
20
$this->
setWidth
(
$width
);
21
$this->
setHeight
(
$height
);
22
}
23
24
public
static
function
createByImageId
($imageId,
$width
,
$height
,
$name
=
null
)
25
{
26
$imageData = \CFile::getFileArray($imageId);
27
if
(!$imageData)
28
{
29
throw
new
Main\ObjectNotFoundException
(
"Could not find file"
);
30
}
31
32
return
new
self
($imageData,
$width
,
$height
,
$name
);
33
}
34
35
public
static
function
createByImageData
(
array
$imageData,
$width
,
$height
,
$name
=
null
)
36
{
37
return
new
self
($imageData,
$width
,
$height
,
$name
);
38
}
39
43
public
function
getWidth
()
44
{
45
return
$this->width
;
46
}
47
53
public
function
setWidth
(
$width
)
54
{
55
$this->
width
=
$width
;
56
57
return
$this;
58
}
59
63
public
function
getHeight
()
64
{
65
return
$this->height
;
66
}
67
73
public
function
setHeight
(
$height
)
74
{
75
$this->
height
=
$height
;
76
77
return
$this;
78
}
79
83
public
function
getResizeType
()
84
{
85
return
$this->resizeType
;
86
}
87
93
public
function
setResizeType
(
$resizeType
)
94
{
95
$this->resizeType =
$resizeType
;
96
97
return
$this;
98
}
99
103
public
function
getFilters
()
104
{
105
return
$this->filters
;
106
}
107
113
public
function
setFilters
(
$filters
)
114
{
115
$this->filters =
$filters
;
116
117
return
$this;
118
}
119
123
public
function
getImage
()
124
{
125
return
$this->file
;
126
}
127
128
protected
function
prepareFile
()
129
{
130
$file
= parent::prepareFile();
131
132
$tmpFile = \CFile::resizeImageGet(
133
$file
,
134
[
'width'
=> $this->
getWidth
(),
'height'
=> $this->
getHeight
()],
135
$this->
getResizeType
(),
136
true
,
137
$this->
getFilters
(),
138
true
139
);
140
141
$file
[
'FILE_SIZE'
] = $tmpFile[
'size'
];
142
$file
[
'SRC'
] = $tmpFile[
'src'
];
143
144
return
$file
;
145
}
146
}
Bitrix\Main\Engine\Response\BFile
Определения
bfile.php:9
Bitrix\Main\Engine\Response\BFile\$file
$file
Определения
bfile.php:10
Bitrix\Main\Engine\Response\File\$name
$name
Определения
file.php:14
Bitrix\Main\Engine\Response\ResizedImage
Определения
resizedimage.php:9
Bitrix\Main\Engine\Response\ResizedImage\$showInline
$showInline
Определения
resizedimage.php:10
Bitrix\Main\Engine\Response\ResizedImage\getImage
getImage()
Определения
resizedimage.php:123
Bitrix\Main\Engine\Response\ResizedImage\prepareFile
prepareFile()
Определения
resizedimage.php:128
Bitrix\Main\Engine\Response\ResizedImage\__construct
__construct(array $file, $width, $height, $name=null)
Определения
resizedimage.php:16
Bitrix\Main\Engine\Response\ResizedImage\$height
$height
Определения
resizedimage.php:12
Bitrix\Main\Engine\Response\ResizedImage\setHeight
setHeight($height)
Определения
resizedimage.php:73
Bitrix\Main\Engine\Response\ResizedImage\getFilters
getFilters()
Определения
resizedimage.php:103
Bitrix\Main\Engine\Response\ResizedImage\$width
$width
Определения
resizedimage.php:11
Bitrix\Main\Engine\Response\ResizedImage\getResizeType
getResizeType()
Определения
resizedimage.php:83
Bitrix\Main\Engine\Response\ResizedImage\$resizeType
$resizeType
Определения
resizedimage.php:13
Bitrix\Main\Engine\Response\ResizedImage\setResizeType
setResizeType($resizeType)
Определения
resizedimage.php:93
Bitrix\Main\Engine\Response\ResizedImage\createByImageId
static createByImageId($imageId, $width, $height, $name=null)
Определения
resizedimage.php:24
Bitrix\Main\Engine\Response\ResizedImage\createByImageData
static createByImageData(array $imageData, $width, $height, $name=null)
Определения
resizedimage.php:35
Bitrix\Main\Engine\Response\ResizedImage\getHeight
getHeight()
Определения
resizedimage.php:63
Bitrix\Main\Engine\Response\ResizedImage\setWidth
setWidth($width)
Определения
resizedimage.php:53
Bitrix\Main\Engine\Response\ResizedImage\$filters
$filters
Определения
resizedimage.php:14
Bitrix\Main\Engine\Response\ResizedImage\setFilters
setFilters($filters)
Определения
resizedimage.php:113
Bitrix\Main\Engine\Response\ResizedImage\getWidth
getWidth()
Определения
resizedimage.php:43
Bitrix\Main\ObjectNotFoundException
Определения
ObjectNotFoundException.php:9
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
array
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения
file_new.php:804
BX_RESIZE_IMAGE_EXACT
const BX_RESIZE_IMAGE_EXACT
Определения
constants.php:12
bitrix
modules
main
lib
engine
response
resizedimage.php
Создано системой
1.14.0