@@ -15,7 +15,7 @@ class ImageResize
15
15
const CROPBOTTOM = 3 ;
16
16
const CROPLEFT = 4 ;
17
17
const CROPRIGHT = 5 ;
18
-
18
+
19
19
public $ quality_jpg = 75 ;
20
20
public $ quality_png = 0 ;
21
21
@@ -94,7 +94,7 @@ public function __construct($filename)
94
94
95
95
return $ this ->resize ($ this ->getSourceWidth (), $ this ->getSourceHeight ());
96
96
}
97
-
97
+
98
98
/**
99
99
* Saves new image
100
100
*
@@ -216,7 +216,7 @@ public function output($image_type = null, $quality = null)
216
216
217
217
$ this ->save (null , $ image_type , $ quality );
218
218
}
219
-
219
+
220
220
/**
221
221
* Resizes image according to the given height (width proportional)
222
222
*
@@ -233,7 +233,7 @@ public function resizeToHeight($height, $allow_enlarge = false)
233
233
234
234
return $ this ;
235
235
}
236
-
236
+
237
237
/**
238
238
* Resizes image according to the given width (height proportional)
239
239
*
@@ -299,7 +299,7 @@ public function resize($width, $height, $allow_enlarge = false)
299
299
300
300
return $ this ;
301
301
}
302
-
302
+
303
303
/**
304
304
* Crops image according to the given width, height and crop position
305
305
*
@@ -324,10 +324,10 @@ public function crop($width, $height, $allow_enlarge = false, $position = self::
324
324
$ height = $ this ->getSourceHeight ();
325
325
}
326
326
}
327
-
327
+
328
328
$ ratio_source = $ this ->getSourceWidth () / $ this ->getSourceHeight ();
329
329
$ ratio_dest = $ width / $ height ;
330
-
330
+
331
331
if ($ ratio_dest < $ ratio_source ) {
332
332
$ this ->resizeToHeight ($ height , $ allow_enlarge );
333
333
@@ -350,7 +350,7 @@ public function crop($width, $height, $allow_enlarge = false, $position = self::
350
350
351
351
return $ this ;
352
352
}
353
-
353
+
354
354
/**
355
355
* Gets source width
356
356
*
@@ -360,7 +360,7 @@ public function getSourceWidth()
360
360
{
361
361
return $ this ->original_w ;
362
362
}
363
-
363
+
364
364
/**
365
365
* Gets source height
366
366
*
@@ -389,7 +389,7 @@ public function getDestHeight()
389
389
{
390
390
return $ this ->dest_h ;
391
391
}
392
-
392
+
393
393
/**
394
394
* Gets crop position (X or Y) according to the given position
395
395
*
0 commit comments