General improvements
This commit is contained in:
@@ -28,12 +28,15 @@ class File extends MY_Controller
|
||||
$isThumb = isset($_GET['w']) || isset($_GET['h']);
|
||||
$w = isset($_GET['w']) ? $_GET['w'] : false;
|
||||
$h = isset($_GET['h']) ? $_GET['h'] : false;
|
||||
$imagePath = pathinfo($file['path'], PATHINFO_DIRNAME) . '/' .
|
||||
$basePath = str_replace('\\', DIRECTORY_SEPARATOR, $file['path']);
|
||||
$basePath = str_replace('/', DIRECTORY_SEPARATOR, $basePath);
|
||||
$imagePath = pathinfo($basePath, PATHINFO_DIRNAME) . '/' .
|
||||
($isThumb ? 'thumbs/' : '') .
|
||||
$file['name'] .
|
||||
($w ? '_w' . $w : '') .
|
||||
($h ? '_h' . $h : '') .
|
||||
'.' . pathinfo($file['path'], PATHINFO_EXTENSION);
|
||||
'.' . pathinfo($basePath, PATHINFO_EXTENSION);
|
||||
$imagePath = str_replace('/', DIRECTORY_SEPARATOR, $imagePath);
|
||||
|
||||
if (!file_exists($imagePath)) {
|
||||
if(!$isThumb)
|
||||
|
Reference in New Issue
Block a user