image
image copied to clipboard
Image resizes with 1px border randomly appear next to the image.
Hello, similar to https://github.com/Intervention/image/issues/168 i have the same problem i am using the latest version of image intervention.
The code i am using:
$image = Image::make($img_path);
$image->orientate();
if ($image->width() > $width) {
$image->resize($width, null, function ($constraint) {
$constraint->aspectRatio();
});
}
if ($image->height() > $height) {
$image->resize(null, $height, function ($constraint) {
$constraint->aspectRatio();
});
}
$image->resizeCanvas($width, $height, 'center', false, $hex);
Original file: https://i.imgur.com/CU3MnCB.jpg Result resized to 280x158: https://i.imgur.com/XYTPGKY.jpg Notice the white border on the top of the resized image, it should not be there.
I tried almost everything.. The proportions of the original image from the first url is 16/9 also the size 280x158 is 16/9 format..
Any help is appreciated.