Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ImageMedium#derivatives now works with image filters #1107

Merged
merged 10 commits into from
Oct 23, 2016
Prev Previous commit
Changed image derivatives prettynames to be width based
Instead of example2x.jpeg, we now have eg. example1280w.jpeg
  • Loading branch information
fredrikekelund committed Oct 21, 2016
commit baa1d8732e780bcb5ceb311d6c9921a37ebbd3f1
2 changes: 1 addition & 1 deletion system/src/Grav/Common/Page/Medium/ImageMedium.php
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ public function derivatives($min_width, $max_width, $step = 200) {
}
}

$basename = preg_replace('/(@\d+x)*$/', "@{$index}x", $base->get('basename'), 1);
$basename = preg_replace('/(@\d+x){0,1}$/', "@{$width}w", $base->get('basename'), 1);
$derivative->setImagePrettyName($basename);

$ratio = $base->get('width') / $width;
Expand Down