Skip to content

Commit 05863bc

Browse files
committed
Merge pull request #7 from cainmi/pull-7
Fix for cropping wide images
2 parents ca1fbc2 + c0fb7f3 commit 05863bc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/ImageResize.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ public function crop($width, $height, $allow_enlarge = false)
222222
$ratio_dest = $width / $height;
223223

224224
if ($ratio_dest < $ratio_source) {
225-
$this->source_w *= $ratio_dest;
225+
$this->source_w /= $ratio_source;
226226
$this->source_x = ($this->getSourceWidth() - $this->source_w) / 2;
227227
} else {
228228
$this->source_h /= $ratio_dest;

0 commit comments

Comments
 (0)