Cache Filter Issue Fixed
This commit is contained in:
parent
b1911bd661
commit
2a139ad91a
|
|
@ -8,16 +8,19 @@ use Intervention\Image\Filters\FilterInterface;
|
|||
class Large implements FilterInterface
|
||||
{
|
||||
/**
|
||||
* Apply filter.
|
||||
*
|
||||
* @param \Intervention\Image\Image $image
|
||||
* @return \Intervention\Image\Image
|
||||
*/
|
||||
public function applyFilter(Image $image)
|
||||
{
|
||||
$width = core()->getConfigData('catalog.products.cache-large-image.width') ?? 480;
|
||||
$height = core()->getConfigData('catalog.products.cache-large-image.height') ?? 480;
|
||||
$width = core()->getConfigData('catalog.products.cache-large-image.width') != '' ? core()->getConfigData('catalog.products.cache-large-image.width') : 480;
|
||||
|
||||
$height = core()->getConfigData('catalog.products.cache-large-image.height') != '' ? core()->getConfigData('catalog.products.cache-large-image.height') : 480;
|
||||
|
||||
return $image->resize($width, $height, function ($constraint) {
|
||||
$constraint->aspectRatio();
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,13 +8,16 @@ use Intervention\Image\Filters\FilterInterface;
|
|||
class Medium implements FilterInterface
|
||||
{
|
||||
/**
|
||||
* Apply filter.
|
||||
*
|
||||
* @param \Intervention\Image\Image $image
|
||||
* @return \Intervention\Image\Image
|
||||
*/
|
||||
public function applyFilter(Image $image)
|
||||
{
|
||||
$width = core()->getConfigData('catalog.products.cache-medium-image.width') ?? 280;
|
||||
$height = core()->getConfigData('catalog.products.cache-medium-image.height') ?? 280;
|
||||
$width = core()->getConfigData('catalog.products.cache-medium-image.width') != '' ? core()->getConfigData('catalog.products.cache-medium-image.width') : 280;
|
||||
|
||||
$height = core()->getConfigData('catalog.products.cache-medium-image.height') != '' ? core()->getConfigData('catalog.products.cache-medium-image.height') : 280;
|
||||
|
||||
$image->resize($width, $height, function ($constraint) {
|
||||
$constraint->aspectRatio();
|
||||
|
|
@ -22,4 +25,4 @@ class Medium implements FilterInterface
|
|||
|
||||
return $image->resizeCanvas($width, $height, 'center', false, '#fff');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,13 +8,16 @@ use Intervention\Image\Filters\FilterInterface;
|
|||
class Small implements FilterInterface
|
||||
{
|
||||
/**
|
||||
* Apply filter.
|
||||
*
|
||||
* @param \Intervention\Image\Image $image
|
||||
* @return \Intervention\Image\Image
|
||||
*/
|
||||
public function applyFilter(Image $image)
|
||||
{
|
||||
$width = core()->getConfigData('catalog.products.cache-small-image.width') ?? 120;
|
||||
$height = core()->getConfigData('catalog.products.cache-small-image.height') ?? 120;
|
||||
$width = core()->getConfigData('catalog.products.cache-small-image.width') ? core()->getConfigData('catalog.products.cache-small-image.width') : 120;
|
||||
|
||||
$height = core()->getConfigData('catalog.products.cache-small-image.height') ? core()->getConfigData('catalog.products.cache-small-image.height') : 120;
|
||||
|
||||
$image->resize($width, $height, function ($constraint) {
|
||||
$constraint->aspectRatio();
|
||||
|
|
@ -22,4 +25,4 @@ class Small implements FilterInterface
|
|||
|
||||
return $image->resizeCanvas($width, $height, 'center', false, '#fff');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue