hi
the following funtion to create thumbnail is called:

function copyImage($srcFile, $destFile, $w, $h, $quality = 75)
{
    
    $tmpSrc     = pathinfo(strtolower($srcFile));
    $tmpDest    = pathinfo(strtolower($destFile));
    $size       = getimagesize($srcFile);

    if ($tmpDest['extension'] == "gif" || $tmpDest['extension'] == "jpg")
    {
       $destFile  = substr_replace($destFile, 'jpg', -3);
       $dest      = imagecreatetruecolor($w, $h);
       imageantialias($dest, TRUE);
    } elseif ($tmpDest['extension'] == "png") {
       $dest = imagecreatetruecolor($w, $h);
       imageantialias($dest, TRUE);
    } else {
      return false;
    }

    switch($size[2])
    {
       case 1:       //GIF
           $src = imagecreatefromgif($srcFile);
           break;
       case 2:       //JPEG
           $src = imagecreatefromjpeg($srcFile);
           break;
       case 3:       //PNG
           $src = imagecreatefrompng($srcFile);
           break;
       default:
           return false;
           break;
    }

    imagecopyresampled($dest, $src, 0, 0, 0, 0, $w, $h, $size[0], $size[1]);

    switch($size[2])
    {
       case 1:
       case 2:
           imagejpeg($dest,$destFile, $quality);
           break;
       case 3:
           imagepng($dest,$destFile);
    }
    return $destFile;

1.I want to see the output of $dest,$src.
2.Also want to see the output of imageantialias($dest, TRUE), imagejpeg($dest,$destFile, $quality);,
imagecopyresampled($dest, $src, 0, 0, 0, 0, $w, $h, $size[0], $size[1]);
so i am assigning a variable to it say $a=imageantialias($dest, TRUE) , $b=imagejpeg($dest,$destFile, $quality); and $c=
imagecopyresampled($dest, $src, 0, 0, 0, 0, $w, $h, $size[0], $size[1]);
All the above are image funtions...
what codes are used..??

Dani AI

Generated

— short, practical notes so the current code behaves the way you expect.

$src and $dest are GD image handles (a resource in older PHP, a GdImage object in PHP 8+). They are not human‑readable image data, so "seeing" them means inspecting their type and properties or viewing the image they represent. Use debugging helpers to check type and dimensions and sample pixels:

var_dump($src);
if (is_resource($src) || (class_exists('GdImage') && $src instanceof GdImage)) {
    echo 'size: ' . imagesx($src) . 'x' . imagesy($src) . "\n";
    echo 'pixel(0,0): ' . imagecolorat($src, 0, 0) . "\n";
}
var_dump($dest);

About the functions you mentioned: the image-creation functions return the handle (or false on failure). Functions such as the antialias toggle, the resample/copy call, and the save/output calls return boolean true/false to indicate success; they do not return a new image object — they modify the destination image in place (or write a file/output stream). So assigning their return to $a, $b, $c is fine for checking success, but to inspect the actual image content you must examine $dest (as above) or save/output it and open it in an image viewer.

Quick troubleshooting checklist: confirm GD is installed (extension_loaded('gd') or function_exists), verify input paths and permissions, check getimagesize() for valid input, use var_dump() and error_get_last() when a function returns false, enable error reporting while debugging, and free images with imagedestroy() when done. See the PHP manual for details on functions and return values: imageantialias, imagecopyresampled, imagesx.

hi
could you give me the solution please....??

Hi
Can i know the reason why i am not getting any reply from you for my above question??:icon_sad:

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.