From ba0dc8ecf1a64fed0a00eb3abfd5398635db00ae Mon Sep 17 00:00:00 2001 From: Guilhem Malfre Date: Sun, 24 Sep 2017 19:14:54 +0900 Subject: [PATCH] Fixed various bugs (missing variables, namespaces) --- src/ImageController.php | 13 +++++++------ src/ImageResizer.php | 2 +- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/ImageController.php b/src/ImageController.php index d1bfae6..e1d5b01 100644 --- a/src/ImageController.php +++ b/src/ImageController.php @@ -16,12 +16,13 @@ public function __construct() { */ public function getGenerateImage() { - if(\Input::has('filename') && \Input::has('type') && \Input::has('size')) { - $basename = \Input::get('filename'); - $type = \Input::get('type'); - $size = \Input::get('size'); + if(\Illuminate\Support\Facades\Input::has('filename') && \Illuminate\Support\Facades\Input::has('type') && \Illuminate\Support\Facades\Input::has('size')) { + $basename = \Illuminate\Support\Facades\Input::get('filename'); + $type = \Illuminate\Support\Facades\Input::get('type'); + $size = \Illuminate\Support\Facades\Input::get('size'); - $type_config = \ImageResizer::getTypeSizeConfig($type, $size); + Facades\ImageResizer::info(); // forcing initialization, in particular loading the config + $type_config = ImageResizerConfig::getTypeSizeConfig($type, $size); $image_file = new ImageFile; $image_file = $image_file->setFileInfoFromPath($type_config['original'].'/'.$basename); @@ -37,4 +38,4 @@ public function getGenerateImage() abort(404); } } -} \ No newline at end of file +} diff --git a/src/ImageResizer.php b/src/ImageResizer.php index b238c04..908e2d3 100644 --- a/src/ImageResizer.php +++ b/src/ImageResizer.php @@ -482,7 +482,7 @@ public function getOutputPaths($type, $size, $basename) } } - return compact('compiled_file', 'public_file'); + return compact('compiled_file', 'public_file', 'original_file'); } /**