diff --git a/administrator/components/com_spsimpleportfolio/controllers/item.php b/administrator/components/com_spsimpleportfolio/controllers/item.php index 54e693c..5d7a63e 100644 --- a/administrator/components/com_spsimpleportfolio/controllers/item.php +++ b/administrator/components/com_spsimpleportfolio/controllers/item.php @@ -41,7 +41,8 @@ protected function postSaveHook(BaseDatabaseModel $model, $validData = array()) * remove extra value form image name. */ $filteredImage = explode('?', $item->image); - $item->image = $filteredImage[0]; + //$item->image = $filteredImage[0]; + $item->image = str_replace('%20', ' ', $filteredImage[0]); $image = JPATH_ROOT . '/' . $item->image; $alias = $item->alias; diff --git a/administrator/components/com_spsimpleportfolio/helpers/spsimpleportfolio.php b/administrator/components/com_spsimpleportfolio/helpers/spsimpleportfolio.php index b1cc3ac..d90daa6 100644 --- a/administrator/components/com_spsimpleportfolio/helpers/spsimpleportfolio.php +++ b/administrator/components/com_spsimpleportfolio/helpers/spsimpleportfolio.php @@ -90,8 +90,12 @@ public static function createThumbs($src, $sizes = array(), $folder = '', $base_ } $x = 0; } - - $new = imagecreatetruecolor($targetWidth, $targetHeight); + try { + $new = imagecreatetruecolor($targetWidth, $targetHeight); + } catch (\Exception $e) { + Factory::getApplication()->enqueueMessage($e->getMessage(), 'error'); + } + if($ext == "gif" or $ext == "png") { imagecolortransparent($new, imagecolorallocatealpha($new, 0, 0, 0, 127));