----------------------------------- Amailer Sun Nov 02, 2003 1:03 am new image problems... ----------------------------------- $new_width = 90; $new_height = 90; $destimg=ImageCreate($new_width,$new_height) or die("Problem In Creating image"); $srcimg=ImageCreateFromJPEG($im) or die("Problem In opening Source Image"); imagecopyresized($destimg,$srcimg,0,0,0,0,$new_width,$new_height,ImageSX($srcimg),ImageSY($srcimg)) or die("Problem In resizing"); ImageJPEG($destimg,$im) or die("Problem In saving"); imagedestroy($im); WAHTS WRONG...WHATS WRONG... ----------------------------------- octopi Sun Nov 02, 2003 2:38 pm ----------------------------------- $im is not defined....what error messages do you get? ----------------------------------- Amailer Sun Nov 02, 2003 5:17 pm ----------------------------------- Oh, hm it is...its... $im = "./img/test.jpg"; And no error messages :S! :S http://amailer.sourceforge.net/new_image.php ----------------------------------- octopi Sun Nov 02, 2003 6:17 pm ----------------------------------- what about your error logs? ----------------------------------- Amailer Sun Nov 02, 2003 6:23 pm ----------------------------------- Hmm, not on my server so...idk. I think i got a diffrent gd dll then sourceforge. idk Ill try it on my server brb [Sun Nov 02 00:14:45 2003] [error] [client 24.101.23.162] File does not exist: C:/Program Files/Apache Group/Apache2/htdocs/Avatar.jpg, referer: http://www.compsci.ca/v2/viewtopic.php?t=2057 [Sun Nov 02 00:18:57 2003] [warn] (OS 64)The specified network name is no longer available. : winnt_accept: Asynchronous AcceptEx failed. [Sun Nov 02 00:24:16 2003] [error] [client 64.68.82.18] File does not exist: C:/Program Files/Apache Group/Apache2/htdocs/robots.txt [Sun Nov 02 00:26:22 2003] [error] [client 65.95.157.35] File does not exist: C:/Program Files/Apache Group/Apache2/htdocs/Avatar.jpg, referer: http://www.compsci.ca/v2/viewtopic.php?p=18271 [Sun Nov 02 00:32:54 2003] [error] [client 204.95.98.253] File does not exist: C:/Program Files/Apache Group/Apache2/htdocs/termix/Forum/robots.txt [Sun Nov 02 00:34:36 2003] [error] [client 64.228.137.246] File does not exist: C:/Program Files/Apache Group/Apache2/htdocs/Avatar.jpg, referer: http://www.compsci.ca/v2/viewtopic.php?t=1653 [Sun Nov 02 01:28:15 2003] [error] [client 64.68.82.204] File does not exist: C:/Program Files/Apache Group/Apache2/htdocs/robots.txt [Sun Nov 02 13:49:56 2003] [notice] Parent: Created child process 712 [Sun Nov 02 13:49:57 2003] [notice] Child 712: Child process is running [Sun Nov 02 13:49:57 2003] [notice] Child 712: Acquired the start mutex. [Sun Nov 02 13:49:57 2003] [notice] Child 712: Starting 250 worker threads. [Sun Nov 02 17:18:12 2003] [error] [client 66.185.85.69] File does not exist: C:/Program Files/Apache Group/Apache2/htdocs/Avatar.jpg, referer: http://www.compsci.ca/v2/viewtopic.php?t=2155&highlight= ----------------------------------- octopi Sun Nov 02, 2003 6:26 pm ----------------------------------- Oh, sourceforge uses linux, so it doesn't use dll files. Ask the admin's if there php version was compiled with gd support. "Is php on your servers complied with gd?" Or just put this in a file and see for your self Check what version they have. ----------------------------------- Amailer Sun Nov 02, 2003 6:27 pm ----------------------------------- But it dont' wrk on my own server its self :S and here, http://amailer.sourceforge.net/phpinfo.php HMM? [Sun Nov 02 17:18:12 2003] [error] [client 66.185.85.69] File does not exist: C:/Program Files/Apache Group/Apache2/htdocs/Avatar.jpg, referer: http://www.compsci.ca/v2/viewtopic.php?t=2155&highlight= [Sun Nov 02 17:31:16 2003] [error] [client 205.211.56.77] File does not exist: C:/Program Files/Apache Group/Apache2/htdocs/Avatar.jpg, referer: http://www.compsci.ca/v2/viewtopic.php?t=2155 Why is it searchign for avatar.jpg??? avatar is a folder... C:/Program Files/Apache Group/Apache2/htdocs/img/Avatar/ ----------------------------------- octopi Sun Nov 02, 2003 6:35 pm ----------------------------------- Post the whole code, cause you can't expect me to find a problem when you only post a small part of it. ----------------------------------- Amailer Sun Nov 02, 2003 6:38 pm ----------------------------------- In the images/avatar folder there are 3 images: theonetokill-avatar.jpg OneToKills2.jpg admin-avatar.jpg Basically it displays randome images that have been resized to 90x90 px ----------------------------------- octopi Sun Nov 02, 2003 6:40 pm ----------------------------------- Does images[] have any values.....if it doesn't then the program would just goto the Dir specified...and might try to add a .jpg extention to it. That would explain your error in the logs. ----------------------------------- Amailer Sun Nov 02, 2003 6:49 pm ----------------------------------- It does, it works prefectly with out creating an image, ill show you. that way it works, But, the other way it don't. http://termix-zero.ath.cx/pictures/new_image.php view its souce, i get: Warning: imagedestroy(): supplied argument is not a valid Image resource in C:\Program Files\Apache Group\Apache2\htdocs\pictures\new_image.php on line 43 ----------------------------------- Amailer Sun Nov 02, 2003 7:00 pm ----------------------------------- Look... [Sun Nov 02 13:49:56 2003] [notice] Parent: Created child process 712 [Sun Nov 02 13:49:57 2003] [notice] Child 712: Child process is running [Sun Nov 02 13:49:57 2003] [notice] Child 712: Acquired the start mutex. [Sun Nov 02 13:49:57 2003] [notice] Child 712: Starting 250 worker threads. [Sun Nov 02 17:18:12 2003] [error] [client 66.185.85.69] File does not exist: C:/Program Files/Apache Group/Apache2/htdocs/Avatar.jpg, referer: http://www.compsci.ca/v2/viewtopic.php?t=2155&highlight= [Sun Nov 02 17:31:16 2003] [error] [client 205.211.56.77] File does not exist: C:/Program Files/Apache Group/Apache2/htdocs/Avatar.jpg, referer: http://www.compsci.ca/v2/viewtopic.php?t=2155 [Sun Nov 02 17:39:32 2003] [error] [client 64.231.193.26] File does not exist: C:/Program Files/Apache Group/Apache2/htdocs/Avatar.jpg, referer: http://www.compsci.ca/v2/viewtopic.php?t=2155 [Sun Nov 02 17:40:26 2003] [error] [client 192.168.1.1] File does not exist: C:/Program Files/Apache Group/Apache2/htdocs/Avatar.jpg, referer: http://www.compsci.ca/v2/viewtopic.php?t=2155 [Sun Nov 02 17:56:48 2003] [error] [client 192.168.1.1] Not a JPEG file: starts with 0x47 0x49 [Sun Nov 02 17:56:50 2003] [error] [client 192.168.1.1] Not a JPEG file: starts with 0x47 0x49 [Sun Nov 02 17:56:51 2003] [error] [client 192.168.1.1] Not a JPEG file: starts with 0xd0 0xcf [Sun Nov 02 17:56:52 2003] [error] [client 192.168.1.1] Not a JPEG file: starts with 0x47 0x49 ----------------------------------- octopi Sun Nov 02, 2003 7:28 pm ----------------------------------- Didn't you say $im was just a path name, and not an image resource? Do you understand what imagedestory() does? ----------------------------------- Amailer Sun Nov 02, 2003 7:53 pm ----------------------------------- the $im has the the image (eg. ./img/avatar/image.jpg) Either way, with and without the imagedestory() it does not work :SS:S ----------------------------------- octopi Sun Nov 02, 2003 10:57 pm ----------------------------------- Well...you were using imagedestory wrong... Look at your error's its telling you the problem...your trying to open a Jpeg image, that isn't a jpeg image. Theres nothing else I can do....you should check the paths, and stuff, and see exactly where its looking for the file, before you try and show the image. ----------------------------------- Amailer Sun Nov 02, 2003 11:10 pm ----------------------------------- Oh very odd, ill recreate that image and SAVE as JPG :S ----------------------------------- Amailer Mon Nov 03, 2003 9:53 pm ----------------------------------- OK I GOT IT TO WORK FOR ME (MY SERVER!) http://termix-zero.ath.cx/pictures/new_image.php if (isset($im)) { // Generate a thumbnail of the image if (!isset($iw)) { $iw = 90; } $iname = $im; if (ereg('png$',$im)) { header("Content-Type: image/png"); $i = imagecreatefrompng($iname); } if (ereg('jpg$',$im)) { header("Content-Type: image/jpeg"); $i = imagecreatefromjpeg($iname); } if (ereg('gif$',$im)) { header("Content-Type: image/gif"); $i = imagecreatefromgif($iname); } $i2 = imagecreatetruecolor($iw,($iw*(imagesy($i)/imagesx($i)))+1); imagecopyresized($i2,$i,0,0,0,0,$iw,$iw*(imagesy($i)/imagesx($i))+1,imagesx($i),imagesy($i)); imagejpeg($i2); exit; WORKS ;D BUT NOT ON THE SOURCEFORGE SERVER HELP NOTE: THIS TIME IM USING PNGS! ----------------------------------- Amailer Mon Nov 03, 2003 9:56 pm ----------------------------------- NEVER MIND...WRONG DIR :S! EXCEPT THE QULITY IS VERY BAD...how to improve it?