Welcome Guest, Not a member yet? Register   Sign In
image_create_gd
#1

png's are not working in image_create_gd


I have put

error_reporting(E_ALL);
ini_set('display_errors', 1); 



Bu there are no error messages, log messages or anything to what what the problem is






Code:
function image_create_gd($path = '', $image_type = '')
    {
        echo "xxxx - aa";
        if ($path == '')
            $path = $this->full_src_path;

        if ($image_type == '')
            $image_type = $this->image_type;
echo $path;
echo "xxxx - bb";
echo $image_type;
        switch ($image_type)
        {
            case     1 :
                        if ( ! function_exists('imagecreatefromgif'))
                        {
                            $this->set_error(array('imglib_unsupported_imagecreate', 'imglib_gif_not_supported'));
                            return FALSE;
                        }

                        return imagecreatefromgif($path);
                break;
            case 2 :
                        if ( ! function_exists('imagecreatefromjpeg'))
                        {
                            $this->set_error(array('imglib_unsupported_imagecreate', 'imglib_jpg_not_supported'));
                            return FALSE;
                        }

                        return imagecreatefromjpeg($path);
                break;
            case 3 :
                        echo "xxxx - cc";
                        if ( ! function_exists('imagecreatefrompng'))
                        {
                            echo "xxxx - dd";
                            $this->set_error(array('imglib_unsupported_imagecreate', 'imglib_png_not_supported'));
                            return FALSE;
                        }
echo "xxxx - eee";
echo $path;


$a = getimagesize($path);
echo "width = " . $a[0];
echo "height = " . $a[1];
echo "type = " . $a[2];
echo "<img src='" . $path .  "'/>";

$test = imagecreatefrompng($path);
if (false === $test)
{
   echo "xxxx - ffff";
}

echo "xxxx - ggg";
                        return imagecreatefrompng($path);
                break;

        }

        $this->set_error(array('imglib_unsupported_imagecreate'));
        return FALSE;
    }




echo "xxxx - aa"; is coming out

echo "xxxx - cc"; is coming out

then
echo "xxxx - eee"; is coming out

so imagecreatefrompng exists

echo $path; gives



home/sweetlocation/public_html/assets/properties/216841/md/1.png


$a = getimagesize($path);
echo "width = " . $a[0];
echo "height = " . $a[1];
echo "type = " . $a[2];

gives

width = 620height = 413type = 3


Then nothing at all. No echo messages, log messages or error messages. It just stops 100% dead on imagecreatefrompng($path). I have no idea why or what to do














Reply


Messages In This Thread
image_create_gd - by Knutsford - 01-06-2017, 06:48 AM
RE: image_create_gd - by Narf - 01-06-2017, 07:08 AM
RE: image_create_gd - by Knutsford - 01-06-2017, 07:43 AM
RE: image_create_gd - by Narf - 01-06-2017, 07:50 AM
RE: image_create_gd - by Knutsford - 01-06-2017, 08:11 AM
RE: image_create_gd - by Narf - 01-06-2017, 08:28 AM
RE: image_create_gd - by Knutsford - 01-06-2017, 08:45 AM
RE: image_create_gd - by Narf - 01-06-2017, 09:25 AM
RE: image_create_gd - by Knutsford - 01-06-2017, 09:45 AM
RE: image_create_gd - by Knutsford - 01-06-2017, 09:50 AM
RE: image_create_gd - by Knutsford - 01-06-2017, 09:53 AM
RE: image_create_gd - by Narf - 01-06-2017, 09:51 AM



Theme © iAndrew 2016 - Forum software by © MyBB