@@ -280,15 +280,15 @@ public function output($image_type = null, $quality = null)
280
280
public function resizeToShortSide ($ max_short , $ allow_enlarge = false )
281
281
{
282
282
if ($ this ->getSourceHeight () < $ this ->getSourceWidth ()) {
283
- $ ratio = $ height / $ this ->getSourceHeight ();
283
+ $ ratio = $ max_short / $ this ->getSourceHeight ();
284
284
$ width = $ this ->getSourceWidth () * $ ratio ;
285
285
286
- $ this ->resize ($ width , $ height , $ allow_enlarge );
286
+ $ this ->resize ($ width , $ max_short , $ allow_enlarge );
287
287
} else {
288
- $ ratio = $ height / $ this ->getSourceWidth ();
288
+ $ ratio = $ max_short / $ this ->getSourceWidth ();
289
289
$ width = $ this ->getSourceHeight () * $ ratio ;
290
290
291
- $ this ->resize ($ width , $ height , $ allow_enlarge );
291
+ $ this ->resize ($ width , $ max_short , $ allow_enlarge );
292
292
}
293
293
294
294
return $ this ;
@@ -304,15 +304,15 @@ public function resizeToShortSide($max_short, $allow_enlarge = false)
304
304
public function resizeToLongSide ($ max_long , $ allow_enlarge = false )
305
305
{
306
306
if ($ this ->getSourceHeight () > $ this ->getSourceWidth ()) {
307
- $ ratio = $ height / $ this ->getSourceHeight ();
307
+ $ ratio = $ max_long / $ this ->getSourceHeight ();
308
308
$ width = $ this ->getSourceWidth () * $ ratio ;
309
309
310
- $ this ->resize ($ width , $ height , $ allow_enlarge );
310
+ $ this ->resize ($ width , $ max_long , $ allow_enlarge );
311
311
} else {
312
- $ ratio = $ height / $ this ->getSourceWidth ();
312
+ $ ratio = $ max_long / $ this ->getSourceWidth ();
313
313
$ width = $ this ->getSourceHeight () * $ ratio ;
314
314
315
- $ this ->resize ($ width , $ height , $ allow_enlarge );
315
+ $ this ->resize ($ width , $ max_long , $ allow_enlarge );
316
316
}
317
317
318
318
return $ this ;
0 commit comments