Forum Moderators: coopster

Message Too Old, No Replies

imagecreatefromjpeg wont show image

         

dennyhot

10:47 pm on Aug 4, 2010 (gmt 0)

10+ Year Member



hi guys i have a problem with mi security image on my site in the register area.
the security image will not show.

heres the error iam getting

Warning: imagecreatefromjpeg(background1.jpg) [function.imagecreatefromjpeg]: failed to open stream: No such file or directory in /home/sites/strikereurope.com/public_html/randomimage.php on line 13

Warning: imagecolorallocate(): supplied argument is not a valid Image resource in /home/sites/strikereurope.com/public_html/randomimage.php on line 15

Warning: imagestring(): supplied argument is not a valid Image resource in /home/sites/strikereurope.com/public_html/randomimage.php on line 18

Warning: Cannot modify header information - headers already sent by (output started at /home/sites/strikereurope.com/public_html/randomimage.php:13) in /home/sites/strikereurope.com/public_html/randomimage.php on line 24

Warning: Cannot modify header information - headers already sent by (output started at /home/sites/strikereurope.com/public_html/randomimage.php:13) in /home/sites/strikereurope.com/public_html/randomimage.php on line 27

Warning: Cannot modify header information - headers already sent by (output started at /home/sites/strikereurope.com/public_html/randomimage.php:13) in /home/sites/strikereurope.com/public_html/randomimage.php on line 30

Warning: Cannot modify header information - headers already sent by (output started at /home/sites/strikereurope.com/public_html/randomimage.php:13) in /home/sites/strikereurope.com/public_html/randomimage.php on line 31

Warning: Cannot modify header information - headers already sent by (output started at /home/sites/strikereurope.com/public_html/randomimage.php:13) in /home/sites/strikereurope.com/public_html/randomimage.php on line 34

Warning: Cannot modify header information - headers already sent by (output started at /home/sites/strikereurope.com/public_html/randomimage.php:13) in /home/sites/strikereurope.com/public_html/randomimage.php on line 38

Warning: imagejpeg(): supplied argument is not a valid Image resource in /home/sites/strikereurope.com/public_html/randomimage.php on line 41

Warning: imagedestroy(): supplied argument is not a valid Image resource in /home/sites/strikereurope.com/public_html/randomimage.php on line 44

can anyone help ?

rocknbil

2:48 am on Aug 5, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Welcome aboard dennyhot, these are all cascading from the first error. Look:

Warning: imagecreatefromjpeg(background1.jpg) [function.imagecreatefromjpeg]: failed to open stream: No such file or directory in /home/sites/example.com/public_html/randomimage.php on line 13


Wherever you are uploading or storing "background1.jpg" it can't find it. Specify the full path to "wherever you want it", and make sure it's writable too, like

$uploads = 'my-uploads';

imagecreatefromjpeg($_SERVER['DOCUMENT_ROOT'] . "/$uploads/background1.jpg");

will be the same as

/home/sites/example.com/public_html/my-uploads/background1.jpg