@@ 75-85 (lines=11) @@ | ||
72 | * @param string $filter |
|
73 | * @return self |
|
74 | */ |
|
75 | public function resize($width, $height, $filter = ImageInterface::FILTER_UNDEFINED) |
|
76 | { |
|
77 | \Yii::trace('resize file', __METHOD__); |
|
78 | ||
79 | $this->mark(__METHOD__, func_get_args()); |
|
80 | $this->save(function () use ($width, $height, $filter) { |
|
81 | return Image::resize($this->File->getAbsolutePath(), $width, $height, $filter); |
|
82 | }); |
|
83 | ||
84 | return $this; |
|
85 | } |
|
86 | ||
87 | /** |
|
88 | * @param integer $width |
|
@@ 92-103 (lines=12) @@ | ||
89 | * @param string $filter |
|
90 | * @return self |
|
91 | */ |
|
92 | public function resizeByWidth($width, $filter = ImageInterface::FILTER_UNDEFINED) |
|
93 | { |
|
94 | \Yii::trace('resizeByWidth file', __METHOD__); |
|
95 | ||
96 | $this->mark(__METHOD__, func_get_args()); |
|
97 | $this->save(function () use ($width, $filter) { |
|
98 | return Image::resizeByWidth($this->File->getAbsolutePath(), $width, $filter); |
|
99 | }); |
|
100 | ||
101 | return $this; |
|
102 | ||
103 | } |
|
104 | ||
105 | /** |
|
106 | * @param integer $height |
|
@@ 110-120 (lines=11) @@ | ||
107 | * @param string $filter |
|
108 | * @return self |
|
109 | */ |
|
110 | public function resizeByHeight($height, $filter = ImageInterface::FILTER_UNDEFINED) |
|
111 | { |
|
112 | \Yii::trace('resizeByHeight file', __METHOD__); |
|
113 | ||
114 | $this->mark(__METHOD__, func_get_args()); |
|
115 | $this->save(function () use ($height, $filter) { |
|
116 | return Image::resizeByHeight($this->File->getAbsolutePath(), $height, $filter); |
|
117 | }); |
|
118 | ||
119 | return $this; |
|
120 | } |
|
121 | ||
122 | /** |
|
123 | * @param integer $width |
|
@@ 146-156 (lines=11) @@ | ||
143 | * @param string $mode |
|
144 | * @return self |
|
145 | */ |
|
146 | public function thumbnail($width, $height, $mode = ManipulatorInterface::THUMBNAIL_OUTBOUND) |
|
147 | { |
|
148 | \Yii::trace('thumbnail file', __METHOD__); |
|
149 | ||
150 | $this->mark(__METHOD__, func_get_args()); |
|
151 | $this->save(function () use ($width, $height, $mode) { |
|
152 | return Image::thumbnail($this->File->getAbsolutePath(), $width, $height, $mode); |
|
153 | }); |
|
154 | ||
155 | return $this; |
|
156 | } |
|
157 | ||
158 | /** |
|
159 | * @param string $watermarkFilename |