From 0eb842496fd1a1b310b2b7c5fd348e32f7b2fb06 Mon Sep 17 00:00:00 2001 From: Rene Kreijveld Date: Fri, 3 Mar 2017 14:50:28 +0100 Subject: [PATCH] Fixed logging bug --- source/plg_rsfp_imageresize/composer.json | 5 ++ source/plg_rsfp_imageresize/composer.lock | 63 +++++++++++++++++++ .../plg_rsfp_imageresize/rsfpimageresize.php | 16 ++--- .../plg_rsfp_imageresize/rsfpimageresize.xml | 2 +- 4 files changed, 77 insertions(+), 9 deletions(-) create mode 100644 source/plg_rsfp_imageresize/composer.json create mode 100644 source/plg_rsfp_imageresize/composer.lock diff --git a/source/plg_rsfp_imageresize/composer.json b/source/plg_rsfp_imageresize/composer.json new file mode 100644 index 0000000..3416f56 --- /dev/null +++ b/source/plg_rsfp_imageresize/composer.json @@ -0,0 +1,5 @@ +{ + "require": { + "eventviva/php-image-resize": "1.6.*" + } +} diff --git a/source/plg_rsfp_imageresize/composer.lock b/source/plg_rsfp_imageresize/composer.lock new file mode 100644 index 0000000..aeff43e --- /dev/null +++ b/source/plg_rsfp_imageresize/composer.lock @@ -0,0 +1,63 @@ +{ + "_readme": [ + "This file locks the dependencies of your project to a known state", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", + "This file is @generated automatically" + ], + "content-hash": "e7248db5bdc255690f5e7d64015ceeb9", + "packages": [ + { + "name": "eventviva/php-image-resize", + "version": "1.6.2", + "source": { + "type": "git", + "url": "https://github.com/eventviva/php-image-resize.git", + "reference": "8c086aad961c082939ee9e42f83f536f37b73b00" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/eventviva/php-image-resize/zipball/8c086aad961c082939ee9e42f83f536f37b73b00", + "reference": "8c086aad961c082939ee9e42f83f536f37b73b00", + "shasum": "" + }, + "require": { + "ext-exif": "*", + "ext-gd": "*", + "php": ">=5.3.0" + }, + "type": "library", + "autoload": { + "classmap": [ + "lib" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Aditya Patadia", + "homepage": "http://aditya.patadia.org/" + } + ], + "description": "PHP class to re-size and scale images", + "homepage": "https://github.com/eventviva/php-image-resize", + "keywords": [ + "image", + "php", + "resize", + "scale" + ], + "time": "2017-01-19T10:34:05+00:00" + } + ], + "packages-dev": [], + "aliases": [], + "minimum-stability": "stable", + "stability-flags": [], + "prefer-stable": false, + "prefer-lowest": false, + "platform": [], + "platform-dev": [] +} diff --git a/source/plg_rsfp_imageresize/rsfpimageresize.php b/source/plg_rsfp_imageresize/rsfpimageresize.php index caf45f5..4a0efa6 100755 --- a/source/plg_rsfp_imageresize/rsfpimageresize.php +++ b/source/plg_rsfp_imageresize/rsfpimageresize.php @@ -49,7 +49,7 @@ public function rsfp_f_onAfterFileUpload($params) { $lg_height = RSFormProHelper::getConfig('imgresize_lg_height'); // Initialize logging - if ($do_logging == 1) + if ($imgresize_log == 1) { jimport( 'joomla.log.log' ); JLog::addLogger(array('text_file' => 'imageupload.' . date('Y-m-d') . '.log.php'), JLog::ALL, array('imageupload')); @@ -62,7 +62,7 @@ public function rsfp_f_onAfterFileUpload($params) { $file = $params['file']; $name = $params['name']; - if ($do_logging == 1) JLog::add(JText::_('Start processing file ' . $name), JLog::INFO, 'imageupload'); + if ($imgresize_log == 1) JLog::add(JText::_('Start processing file ' . $name), JLog::INFO, 'imageupload'); $upload = pathinfo($file); $image = new ImageResize($file); @@ -72,7 +72,7 @@ public function rsfp_f_onAfterFileUpload($params) { { $image->resizeToBestFit($tn_width, $tn_height); $image->save($upload["dirname"] . '/' . $upload["filename"] . '-tn.' . $upload["extension"]); - if ($do_logging == 1) JLog::add(JText::_('Saved thumbnail version ' . $upload["filename"] . '-tn.' . $upload["extension"]), JLog::INFO, 'imageupload'); + if ($imgresize_log == 1) JLog::add(JText::_('Saved thumbnail version ' . $upload["filename"] . '-tn.' . $upload["extension"]), JLog::INFO, 'imageupload'); } // Extra small @@ -80,7 +80,7 @@ public function rsfp_f_onAfterFileUpload($params) { { $image->resizeToBestFit($xs_width, $xs_height); $image->save($upload["dirname"] . '/' . $upload["filename"] . '-xs.' . $upload["extension"]); - if ($do_logging == 1) JLog::add(JText::_('Saved extra small version ' . $upload["filename"] . '-xs.' . $upload["extension"]), JLog::INFO, 'imageupload'); + if ($imgresize_log == 1) JLog::add(JText::_('Saved extra small version ' . $upload["filename"] . '-xs.' . $upload["extension"]), JLog::INFO, 'imageupload'); } // Small @@ -88,7 +88,7 @@ public function rsfp_f_onAfterFileUpload($params) { { $image->resizeToBestFit($sm_width, $sm_height); $image->save($upload["dirname"] . '/' . $upload["filename"] . '-sm.' . $upload["extension"]); - if ($do_logging == 1) JLog::add(JText::_('Saved small version ' . $upload["filename"] . '-sm.' . $upload["extension"]), JLog::INFO, 'imageupload'); + if ($imgresize_log == 1) JLog::add(JText::_('Saved small version ' . $upload["filename"] . '-sm.' . $upload["extension"]), JLog::INFO, 'imageupload'); } // Medium @@ -96,7 +96,7 @@ public function rsfp_f_onAfterFileUpload($params) { { $image->resizeToBestFit($md_width, $md_height); $image->save($upload["dirname"] . '/' . $upload["filename"] . '-md.' . $upload["extension"]); - if ($do_logging == 1) JLog::add(JText::_('Saved medium version ' . $upload["filename"] . '-md.' . $upload["extension"]), JLog::INFO, 'imageupload'); + if ($imgresize_log == 1) JLog::add(JText::_('Saved medium version ' . $upload["filename"] . '-md.' . $upload["extension"]), JLog::INFO, 'imageupload'); } // Large @@ -104,10 +104,10 @@ public function rsfp_f_onAfterFileUpload($params) { { $image->resizeToBestFit($lg_width, $lg_height); $image->save($upload["dirname"] . '/' . $upload["filename"] . '-lg.' . $upload["extension"]); - if ($do_logging == 1) JLog::add(JText::_('Saved large version ' . $upload["filename"] . '-lg.' . $upload["extension"]), JLog::INFO, 'imageupload'); + if ($imgresize_log == 1) JLog::add(JText::_('Saved large version ' . $upload["filename"] . '-lg.' . $upload["extension"]), JLog::INFO, 'imageupload'); } - if ($do_logging == 1) JLog::add(JText::_('End RSFP Image Resize'), JLog::INFO, 'imageupload'); + if ($imgresize_log == 1) JLog::add(JText::_('End RSFP Image Resize'), JLog::INFO, 'imageupload'); return; diff --git a/source/plg_rsfp_imageresize/rsfpimageresize.xml b/source/plg_rsfp_imageresize/rsfpimageresize.xml index 75a2371..9f6bcb1 100755 --- a/source/plg_rsfp_imageresize/rsfpimageresize.xml +++ b/source/plg_rsfp_imageresize/rsfpimageresize.xml @@ -7,7 +7,7 @@ GNU General Public License version 3 info@renekreijveld.nl www.renekreijveld.nl - 1.0.0 + 1.1 script.php