mirror of
https://github.com/e107inc/e107.git
synced 2025-07-09 17:16:20 +02:00
@ -111,7 +111,7 @@ function resize_image($source_file, $destination_file, $type = "upload", $model
|
|||||||
{
|
{
|
||||||
if (($result = mimeFromFilename($source_file)) === FALSE) { return FALSE; }
|
if (($result = mimeFromFilename($source_file)) === FALSE) { return FALSE; }
|
||||||
header($result);
|
header($result);
|
||||||
if (@readfile($source_file) === FALSE) { return FALSE; }
|
if (e_shims::readfile($source_file) === FALSE) { return FALSE; }
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
16
thumb.php
16
thumb.php
@ -156,6 +156,7 @@ class e_thumbpage
|
|||||||
@require($tmp.DIRECTORY_SEPARATOR.'core_functions.php');
|
@require($tmp.DIRECTORY_SEPARATOR.'core_functions.php');
|
||||||
//e107 class
|
//e107 class
|
||||||
@require($tmp.DIRECTORY_SEPARATOR.'e107_class.php');
|
@require($tmp.DIRECTORY_SEPARATOR.'e107_class.php');
|
||||||
|
e107::autoload_register(array('e107', 'autoload'));
|
||||||
|
|
||||||
$e107_paths = compact(
|
$e107_paths = compact(
|
||||||
'ADMIN_DIRECTORY',
|
'ADMIN_DIRECTORY',
|
||||||
@ -324,11 +325,12 @@ class e_thumbpage
|
|||||||
|
|
||||||
$fname = e107::getParser()->thumbCacheFile($this->_src_path, $options);
|
$fname = e107::getParser()->thumbCacheFile($this->_src_path, $options);
|
||||||
|
|
||||||
if(($this->_cache === true) && is_file(e_CACHE_IMAGE.$fname) && is_readable(e_CACHE_IMAGE.$fname) && ($this->_debug !== true))
|
$cache_filename = e_CACHE_IMAGE . $fname;
|
||||||
|
if(($this->_cache === true) && is_file($cache_filename) && is_readable($cache_filename) && ($this->_debug !== true))
|
||||||
{
|
{
|
||||||
$thumbnfo['lmodified'] = filemtime(e_CACHE_IMAGE.$fname);
|
$thumbnfo['lmodified'] = filemtime($cache_filename);
|
||||||
$thumbnfo['md5s'] = md5_file(e_CACHE_IMAGE.$fname);
|
$thumbnfo['md5s'] = md5_file($cache_filename);
|
||||||
$thumbnfo['fsize'] = filesize(e_CACHE_IMAGE.$fname);
|
$thumbnfo['fsize'] = filesize($cache_filename);
|
||||||
|
|
||||||
// Send required headers
|
// Send required headers
|
||||||
if($this->_debug !== true)
|
if($this->_debug !== true)
|
||||||
@ -349,9 +351,7 @@ class e_thumbpage
|
|||||||
// Send required headers
|
// Send required headers
|
||||||
//$this->sendHeaders($thumbnfo);
|
//$this->sendHeaders($thumbnfo);
|
||||||
|
|
||||||
|
e_shims::readfile($cache_filename);
|
||||||
|
|
||||||
@readfile(e_CACHE_IMAGE.$fname);
|
|
||||||
//$bench->end()->logResult('thumb.php', $_GET['src'].' - retrieve cache');
|
//$bench->end()->logResult('thumb.php', $_GET['src'].' - retrieve cache');
|
||||||
|
|
||||||
exit;
|
exit;
|
||||||
@ -443,7 +443,7 @@ class e_thumbpage
|
|||||||
//exit;
|
//exit;
|
||||||
|
|
||||||
// set cache
|
// set cache
|
||||||
$thumb->save(e_CACHE_IMAGE.$fname);
|
$thumb->save($cache_filename);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user