Skip to content

Commit

Permalink
fix(ResponsiveImageCraft): fix path to config file
Browse files Browse the repository at this point in the history
  • Loading branch information
guillaume-infernal committed Aug 21, 2023
1 parent 1b9143f commit a380928
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/ResponsiveImageCraft.php
Expand Up @@ -24,15 +24,15 @@ public function getCssVariables(string $file, int $maxWidth, array $extensions =
$image = new ImageInfoFromString($file);
$path = $image->getRelativePathnameWithoutExtension();

if (! filter_var($path, FILTER_VALIDATE_URL) && config('responsive-image-craft.use_responsive_images')) {
if (!filter_var($path, FILTER_VALIDATE_URL) && config('responsive-image-craft.use_responsive_images')) {
if (str_starts_with($path, '.')) {
$path = ltrim($path, '.');
}
if (str_starts_with($path, '/')) {
$path = ltrim($path, '/');
}

$baseUrl = config('filesystem.'.config('responsive-image-craft.source_disk').'.url');
$baseUrl = config('filesystem.' . config('responsive-image-craft.source_disk') . '.url');

if (empty($baseUrl)) {
throw InvalidDiskException::urlIsMissing();
Expand All @@ -45,12 +45,12 @@ public function getCssVariables(string $file, int $maxWidth, array $extensions =
$path = "{$baseUrl}/{$path}";
}

$fileNameSpacer = config('responsive-images.filename_spacer');
$fileNameSpacer = config('responsive-image-craft.filename_spacer');

$cssVariables = $this->generateCssVariables($path, $extensions, 'full');

foreach ($image->getFilteredSizes($maxWidth) as $width) {
$file = $path.$fileNameSpacer.$width;
$file = $path . $fileNameSpacer . $width;
$cssVariables .= $this->generateCssVariables($file, $extensions, $width);
}

Expand Down

0 comments on commit a380928

Please sign in to comment.