mirror of
https://github.com/Intervention/image.git
synced 2025-08-31 01:29:51 +02:00
fix
This commit is contained in:
@@ -40,7 +40,7 @@ class ResizeCanvasCommand extends \Intervention\Image\Commands\AbstractCommand
|
||||
$image_size = $image->getSize()->align($anchor);
|
||||
$canvas_pos = $image_size->relativePosition($canvas_size);
|
||||
$image_pos = $canvas_size->relativePosition($image_size);
|
||||
|
||||
|
||||
if ($width <= $original_width) {
|
||||
$dst_x = 0;
|
||||
$src_x = $canvas_pos->x;
|
||||
@@ -65,7 +65,7 @@ class ResizeCanvasCommand extends \Intervention\Image\Commands\AbstractCommand
|
||||
// even if background-color is set
|
||||
$transparent = imagecolorallocatealpha($canvas->getCore(), 0, 0, 0, 127);
|
||||
imagealphablending($canvas->getCore(), false); // do not blend / just overwrite
|
||||
imagefilledrectangle($canvas->getCore(), $dst_x, $dst_y, $src_w + 1, $src_h + 1, $transparent);
|
||||
imagefilledrectangle($canvas->getCore(), $dst_x, $dst_y, $dst_x + $src_w - 1, $dst_y + $src_h - 1, $transparent);
|
||||
|
||||
// copy image into new canvas
|
||||
imagecopy($canvas->getCore(), $image->getCore(), $dst_x, $dst_y, $src_x, $src_y, $src_w, $src_h);
|
||||
|
Reference in New Issue
Block a user