Why is the below occuring??

I am using the most current libraries available.

----- Forwarded message from Bob Federer <[EMAIL PROTECTED]> -----

Resent-Message-Id: <[EMAIL PROTECTED]>
Reply-To: <[EMAIL PROTECTED]>
From: "Bob Federer" <[EMAIL PROTECTED]>
To: "Dave Y" <[EMAIL PROTECTED]>
Subject: image resize error still happening
Date: Sun, 8 Dec 2002 11:42:29 -0500
X-Priority: 3 (Normal)
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0)
Importance: Normal
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106
Resent-From: [EMAIL PROTECTED]
Resent-Date: Mon, 9 Dec 2002 07:47:47 -0700
Resent-To: The Doctor <[EMAIL PROTECTED]>

Hi Dave,
I’m still getting the following error when trying to run any of the scripts
for resizing jpgs:

Fatal error: Call to undefined function: imagecreatefromjpeg() in
/usr/home/swp/html/php/thumbtest.php on line 20

The source for thumbtest.php is as follows if it helps (the file is in the
php folder in swp):

<?
function checkgd(){
            $gd2="";
            ob_start();
            phpinfo(8);
            $phpinfo=ob_get_contents();
            ob_end_clean();
            $phpinfo=strip_tags($phpinfo);
            $phpinfo=stristr($phpinfo,"gd version");
            $phpinfo=stristr($phpinfo,"version");
            $end=strpos($phpinfo," ");
            $phpinfo=substr($phpinfo,0,$end);
            $phpinfo=substr($phpinfo,7);
            if (preg_match("/2./",$phpinfo)){$gd2="yes";}
            return $gd2;
}
function createthumb($name,$filename,$new_w,$new_h){
            global $gd2;
            $system=explode(".",$name);
            if
(preg_match("/jpg|jpeg/",$system[1])){$src_img=imagecreatefromjpeg($name);}
            if
(preg_match("/png/",$system[1])){$src_img=imagecreatefrompng($name);}
            $old_x=imageSX($src_img);
            $old_y=imageSY($src_img);
            if ($old_x > $old_y) {
                        $thumb_w=$new_w;
                        $thumb_h=$old_y*($new_h/$old_x);
            }
            if ($old_x < $old_y) {
                        $thumb_w=$old_x*($new_w/$old_y);
                        $thumb_h=$new_h;
            }
            if ($old_x == $old_y) {
                        $thumb_w=$new_w;
                        $thumb_h=$new_h;
            }
            if ($gd2==""){
                                    $dst_img=ImageCreate($thumb_w,$thumb_h);

imagecopyresized($dst_img,$src_img,0,0,0,0,$thumb_w,$thumb_h,$old_x,$old_y);
            }else{
                        $dst_img=ImageCreateTrueColor($thumb_w,$thumb_h);

imagecopyresampled($dst_img,$src_img,0,0,0,0,$thumb_w,$thumb_h,$old_x,$old_y
);
            }
            if (preg_match("/png/",$system[1])){
                        imagepng($dst_img,$filename);
            } else {
                        imagejpeg($dst_img,$filename);
            }
            imagedestroy($dst_img);
            imagedestroy($src_img);
}

$gd2=checkgd();
print ( $gd2 );

$p="pic1.jpg";

createthumb("pics/".$p,"thumbs/tn_".$p,100,100);


?>


----- End forwarded message -----

-- 
Member - Liberal International  On 11 Sept 2001 the WORLD was violated.
This is [EMAIL PROTECTED]       Ici [EMAIL PROTECTED]
Society MUST be saved! Extremists must dissolve.  
Merry Christmas 2002 and Happy 2003

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to