Skip to content

Commit

Permalink
Fix: image name issue for J4
Browse files Browse the repository at this point in the history
  • Loading branch information
siddik-web committed Apr 8, 2021
1 parent cf21c9c commit 8fe580e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down

0 comments on commit 8fe580e

Please sign in to comment.