Merge pull request #1703 from phillipcodes/bugfix-979/image-scaling

#979 fix image scaling issues
This commit is contained in:
Jitendra Singh 2019-10-29 12:31:19 +05:30 committed by GitHub
commit 2a00d797ca
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 22 additions and 10 deletions

View File

@ -9,6 +9,8 @@ class Large implements FilterInterface
{
public function applyFilter(Image $image)
{
return $image->resize(480, 480);
return $image->resize(480, null, function ($constraint) {
$constraint->aspectRatio();
});
}
}

View File

@ -9,6 +9,12 @@ class Medium implements FilterInterface
{
public function applyFilter(Image $image)
{
return $image->resize(280, 350);
$width = 280;
$height = 280;
$image->resize($width, $height, function ($constraint) {
$constraint->aspectRatio();
});
return $image->resizeCanvas($width, $height, 'center', false, '#fff');
}
}

View File

@ -9,6 +9,12 @@ class Small implements FilterInterface
{
public function applyFilter(Image $image)
{
return $image->resize(120, 120);
$width = 120;
$height = 120;
$image->resize($width, $height, function ($constraint) {
$constraint->aspectRatio();
});
return $image->resizeCanvas($width, $height, 'center', false, '#fff');
}
}

View File

@ -688,8 +688,8 @@ section.slider-block {
}
li img {
height: 500px;
width:100%;
max-height: 500px;
max-width: 100%;
}
}
@ -1488,8 +1488,8 @@ section.slider-block {
width: 100%;
img {
height: 400px;
width:100%;
max-height: 400px;
max-width: 100%;
}
}
}
@ -4316,17 +4316,15 @@ section.review {
float: left;
img {
width: 100%;
max-width: 100%;
&:first-child {
padding-bottom: 20px;
height: 50%;
display: block;
}
&:last-child {
padding-top: 20px;
height: 50%;
display: block;
}
}