Can't Upload Image On Blog Option with (PHP 7.4 & Joomla 4) - Forum | JoomShaper
Staff replied General

Can't Upload Image On Blog Option with (PHP 7.4 & Joomla 4)

Asked by Dinuka 3 years ago Last activity 3 years ago

Previously i posted about can't upload image on blog option in Gazette joomla 4 template with PHP 8.0.
https://www.joomshaper.com/forum/question/23552

As per the support answer given, i reinstall with PHP 7.4.
But Still same issue.

4 replies

Dinuka Asked this

Hi All

I solve this error by changing as below. But i think there should be proper solution for this.

namespace HelixUltimate\Framework\Platform\Classes;

defined('_JEXEC') or die();

/**

  • Image manipulation class.

  • @since 1.0.0
    */
    class Image
    {
    public static function createThumbs($src, $sizes, $folder, $base_name, $ext, $quality = 100)
    {

             list($originalWidth, $originalHeight) = getimagesize($src);
    
             switch ($ext)
             {
                     case 'bmp':
                             $img = imagecreatefromwbmp($src);
                             break;
                     case 'gif':
                             $img = imagecreatefromgif($src);
                             break;
                     case 'jpg':
                             $img = imagecreatefromjpeg($src);
                             break;
                     case 'jpeg':
                             $img = imagecreatefromjpeg($src);
                             break;
                     case 'png':
                             $img = \imagecreatefrompng($src); <-- I changed this line. Added a \ in front of the function name. So the native function of GD is used
                             break;
             }
Mehtaz Afsana Borsha Staff

Hi

Thanks for congtacting us and glad to know that it is solved now. You can now close this post by accepting the answer.

-Regards.

Dinuka Asked this

Dear Mehtaz

it seems to me not a proper solution edit default codings

Mehtaz Afsana Borsha Staff

Ok I will note it down so that we can get a proper solution in near future, in the meanwhile you can use this one.

Log in to reply.