mirror of
https://github.com/getgrav/grav.git
synced 2026-02-21 22:18:03 +01:00
make cache names of generated images more informative by adding correct @#x suffix
This commit is contained in:
@@ -251,7 +251,10 @@ class Media extends Getters
|
||||
$width = (int) ($medium->get('width') * $ratio);
|
||||
$height = (int) ($medium->get('height') * $ratio);
|
||||
|
||||
$file = $medium->resize($width, $height)->url();
|
||||
$basename = $medium->get('basename');
|
||||
$basename = str_replace('@'.$from.'x', '@'.$to.'x', $basename);
|
||||
|
||||
$file = $medium->resize($width, $height)->setPrettyName($basename)->url();
|
||||
$file = preg_replace('|'. preg_quote(self::$grav['base_url_relative']) .'$|', '', GRAV_ROOT) . $file;
|
||||
|
||||
$size = filesize($file);
|
||||
|
||||
@@ -367,6 +367,7 @@ class Medium extends Data
|
||||
if ($method == 'cropZoom') {
|
||||
$method = 'zoomCrop';
|
||||
}
|
||||
|
||||
// Always initialize image.
|
||||
if (!$this->image) {
|
||||
$this->image();
|
||||
|
||||
Reference in New Issue
Block a user