Add default width parameter to resizer
This commit is contained in:
1 parent
03b13733ff
commit
1aa76cb053
2 files changed
+5
-4
No files matched your search
+2
-4
@@ -26,7 +26,7 @@ class Resizer
|
||||
}
|
||||
|
||||
// Fetch the image at the given URL
|
||||
$original_img = Image::fromUrl($_ENV['root_domain'] . $path);
|
||||
$original_img = Image::fromUrl($_ENV['ROOT_DOMAIN'] . $path);
|
||||
$converted = $this->createVariant($original_img, $params);
|
||||
|
||||
// Store the image in the database
|
||||
@@ -44,9 +44,7 @@ class Resizer
|
||||
{
|
||||
$quality = $params->quality ?: -1;
|
||||
|
||||
if ($params->width) {
|
||||
$original->toWidth($params->width);
|
||||
}
|
||||
$original->toWidth($params->width ?? intval($_ENV["DEFAULT_WIDTH"]));
|
||||
|
||||
return $original->encode($quality);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user