From 271e1f5688cb1dbec065dadf07b5ddb1ac12c899 Mon Sep 17 00:00:00 2001 From: mistic100 Date: Fri, 24 Apr 2015 17:06:47 +0000 Subject: feature 3221 Lazy log file open, clean code git-svn-id: http://piwigo.org/svn/trunk@31103 68402e56-0260-453c-a942-63ccdbb3a9ee --- admin/include/image.class.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'admin/include') diff --git a/admin/include/image.class.php b/admin/include/image.class.php index e77699758..ee9b9bb12 100644 --- a/admin/include/image.class.php +++ b/admin/include/image.class.php @@ -621,6 +621,8 @@ class image_ext_imagick implements imageInterface function write($destination_filepath) { + global $logger; + $this->add_command('interlace', 'line'); // progressive rendering // use 4:2:2 chroma subsampling (reduce file size by 20-30% with "almost" no human perception) // @@ -648,13 +650,13 @@ class image_ext_imagick implements imageInterface $dest = pathinfo($destination_filepath); $exec .= ' "'.realpath($dest['dirname']).'/'.$dest['basename'].'" 2>&1'; + $logger->debug($exec, 'i.php'); @exec($exec, $returnarray); - if (function_exists('ilog')) ilog($exec); if (is_array($returnarray) && (count($returnarray)>0) ) { - if (function_exists('ilog')) ilog('ERROR', $returnarray); - foreach($returnarray as $line) + $logger->error('', 'i.php', $returnarray); + foreach ($returnarray as $line) trigger_error($line, E_USER_WARNING); } return is_array($returnarray); -- cgit v1.2.3