| @@ 145-149 (lines=5) @@ | ||
| 142 | } |
|
| 143 | $dirnoslash = str_replace('/', '', substr($fileinfo['dirname'], strpos($fileinfo['dirname'], '/static'))); |
|
| 144 | $path = $dir . '/static/cache/' . $dirnoslash . $fileinfo['filename'] . '.' . $sizes[0] . 'x' . $sizes[1] . $crop . $pos . '.' . $fileinfo['extension']; |
|
| 145 | if (!file_exists($path)) { |
|
| 146 | Tools::createDir($dir . '/static/cache/'); |
|
| 147 | copy($file, $path); |
|
| 148 | Tools::resizeImage($path, $sizes[0], $sizes[1], $crop, $pos); |
|
| 149 | } |
|
| 150 | ||
| 151 | $file = $path; |
|
| 152 | } |
|
| @@ 121-126 (lines=6) @@ | ||
| 118 | $path .= '.' . $sizes['x'] . 'x' . $sizes['y'] . $crop . $pos; |
|
| 119 | } |
|
| 120 | $path .= '.' . $fileinfo['extension']; |
|
| 121 | if (!file_exists($path)) { |
|
| 122 | copy($file, $path); |
|
| 123 | if ($sizes) { |
|
| 124 | Tools::resizeImage($path, $sizes['x'], $sizes['y'], $crop, $pos); |
|
| 125 | } |
|
| 126 | } |
|
| 127 | ||
| 128 | return $path; |
|
| 129 | } |
|