Skip to content

Commit

Permalink
Bugfix the file existance checking for thumbnail.
Browse files Browse the repository at this point in the history
  • Loading branch information
goldsky committed Apr 1, 2011
1 parent 35179d1 commit e65b7d2
Showing 1 changed file with 14 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,6 @@ public function imgShaper(
, $thumbPath = NULL
) {

if (function_exists('set_time_limit'))
@set_time_limit(0);

if (!file_exists(realpath($gdir . $path))) {
return FALSE;
}
Expand All @@ -74,8 +71,20 @@ public function imgShaper(
* If there is no the image's thumbnail inside the thumbnail's path,
* CREATE THE THUMBNAIL
*/
if (!file_exists(realpath($gdir . $thumbPath) && file_exists($gdir . $path))) {
// goldsky -- adds output buffer to avoid PHP's memory limit
if (!file_exists(realpath($gdir . $thumbPath))) {

// Apache's timeout: 300 secs
if (function_exists('ini_get') && !ini_get('safe_mode')) {
if (function_exists('set_time_limit')) {
set_time_limit(300);
}
if (function_exists('ini_set')) {
if (ini_get('max_execution_time') !== 300) {
ini_set('max_execution_time', 300);
}
}
}

ob_start();

$imgSize = @getimagesize($gdir . $path);
Expand Down

0 comments on commit e65b7d2

Please sign in to comment.