Skip to content

Commit

Permalink
Update to 5.13
Browse files Browse the repository at this point in the history
  • Loading branch information
denysdesign committed Feb 11, 2023
1 parent 6f78388 commit 8f35311
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
basedir=".">

<property name="VERSION"
value="5.12" />
value="5.13" />
<property name="build"
value="build" />
<property name="temp"
Expand Down
11 changes: 7 additions & 4 deletions src/Image.php
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ private function thumb($url, array $attr = [])
else
{
$url = $this->path . '/' . $url;
if(!file_exists($url))
if(!is_file($url))
{
$_error = true;
}
Expand Down Expand Up @@ -226,7 +226,7 @@ private function thumb($url, array $attr = [])

// Image Path for target
$target = $subfolder . '/' . $img_url;
if(file_exists($this->path . '/' . $target))
if(is_file($this->path . '/' . $target))
{
return $target;
}
Expand Down Expand Up @@ -255,19 +255,22 @@ private function createThumb($url, $img_cache, $target, array $attr = [])
$phpThumb = new phpthumb();

$phpThumb->resetObject();

$phpThumb->setParameter('config_allow_src_above_docroot', true);
$phpThumb->setParameter('config_max_source_pixels', round(max((int) ini_get('memory_limit'), (int) get_cfg_var('memory_limit')) * 1048576 / 6)); // '0'
$phpThumb->setParameter('config_temp_directory', $this->path . '/' . $img_cache . '/');
$phpThumb->setParameter('config_cache_directory', $this->path . '/' . $img_cache . '/');

$phpThumb->setCacheDirectory();

$phpThumb->setParameter('config_cache_maxfiles', null);
$phpThumb->setParameter('config_cache_maxsize', null);
$phpThumb->setParameter('config_cache_maxage', null);
$phpThumb->setParameter('config_cache_source_filemtime_ignore_local', true);
$phpThumb->setParameter('config_error_die_on_error', true);
$phpThumb->setParameter('config_error_die_on_source_failure', true);
$phpThumb->setParameter('config_error_bgcolor', 'FAFAFA');
$phpThumb->setParameter('config_error_textcolor', '770000');
$phpThumb->setParameter('config_disable_debug', false);
$phpThumb->setParameter('config_nohotlink_enabled', false);
$phpThumb->setParameter('config_http_fopen_timeout', 600);

$imagemagick = true;
Expand Down

0 comments on commit 8f35311

Please sign in to comment.