5
5
use \Exception ;
6
6
7
7
/**
8
- * Handles thumb image(s) according to the original source given.
8
+ * PHP class to resize and scale images
9
9
*/
10
10
class ImageResize
11
11
{
@@ -123,6 +123,7 @@ public function loadFromString($imagedata)
123
123
124
124
/**
125
125
* Loads image source and its properties to the instanciated object
126
+ *
126
127
* @param string $filename
127
128
* @return \static
128
129
* @throws Exception
@@ -164,6 +165,7 @@ public function loadFromFile($filename)
164
165
165
166
/**
166
167
* Saves new image
168
+ *
167
169
* @param string $filename
168
170
* @param string $image_type
169
171
* @param integer $quality
@@ -266,7 +268,7 @@ public function __toString() {
266
268
}
267
269
268
270
/**
269
- * Outputs image source to browser
271
+ * Outputs image to browser
270
272
* @param string $image_type
271
273
* @param integer $quality
272
274
*/
@@ -280,7 +282,8 @@ public function output($image_type = null, $quality = null)
280
282
}
281
283
282
284
/**
283
- * Resizes image according to the given height. Width is proportional.
285
+ * Resizes image according to the given height (width proportional)
286
+ *
284
287
* @param integer $height
285
288
* @param boolean $allow_enlarge
286
289
* @return \static
@@ -296,7 +299,8 @@ public function resizeToHeight($height, $allow_enlarge = false)
296
299
}
297
300
298
301
/**
299
- * Resizes image according to the given width. Height is proportional.
302
+ * Resizes image according to the given width (height proportional)
303
+ *
300
304
* @param integer $width
301
305
* @param boolean $allow_enlarge
302
306
* @return \static
@@ -313,6 +317,7 @@ public function resizeToWidth($width, $allow_enlarge = false)
313
317
314
318
/**
315
319
* Resizes image according to given scale (proportionally)
320
+ *
316
321
* @param type $scale
317
322
* @return \Eventviva\ImageResize
318
323
*/
@@ -328,6 +333,7 @@ public function scale($scale)
328
333
329
334
/**
330
335
* Resizes image according to the given width and height
336
+ *
331
337
* @param integer $width
332
338
* @param integer $height
333
339
* @param boolean $allow_enlarge
@@ -359,8 +365,8 @@ public function resize($width, $height, $allow_enlarge = false)
359
365
}
360
366
361
367
/**
362
- * Crops image according to the given width and height for the new saved
363
- * image. Crop's position may be configured.
368
+ * Crops image according to the given width, height and crop position
369
+ *
364
370
* @param integer $width
365
371
* @param integer $height
366
372
* @param boolean $allow_enlarge
@@ -411,6 +417,7 @@ public function crop($width, $height, $allow_enlarge = false, $position = self::
411
417
412
418
/**
413
419
* Gets source width
420
+ *
414
421
* @return integer
415
422
*/
416
423
public function getSourceWidth ()
@@ -420,6 +427,7 @@ public function getSourceWidth()
420
427
421
428
/**
422
429
* Gets source height
430
+ *
423
431
* @return integer
424
432
*/
425
433
public function getSourceHeight ()
@@ -429,6 +437,7 @@ public function getSourceHeight()
429
437
430
438
/**
431
439
* Gets width of the destination image
440
+ *
432
441
* @return integer
433
442
*/
434
443
public function getDestWidth ()
@@ -446,7 +455,8 @@ public function getDestHeight()
446
455
}
447
456
448
457
/**
449
- * Gets crop position (X or Y) according to the given position.
458
+ * Gets crop position (X or Y) according to the given position
459
+ *
450
460
* @param integer $expectedSize
451
461
* @param integer $position
452
462
* @return integer
0 commit comments