NeoMarine Posted February 4, 2008 Share Posted February 4, 2008 I have a script called getimage.php I call that script in my html tags like <img src="getimage.php?imageID=100" /> However, when I display two on the screen like: <img src="getimage.php?imageID=100" /> <img src="getimage.php?imageID=305" /> They both come back all messed up, each time I refresh the page, they are messed up differently. Inside the getimage.php script I am creating an image by combining multiple images together. I then output them with imageGIF. However, for some reason - even if I have two copies of a the script like: <img src="getimage1.php?imageID=100" /> <img src="getimage2.php?imageID=305" /> The images come back all messed up... The only case where they come back properly is if all the images I am combining are the same in both scripts, however if I use two copies of getimage.php like above: <img src="getimage1.php?imageID=100" /> <img src="getimage2.php?imageID=305" /> Then NO MATTER WHAT they both come back messsed up... AHH please help! Quote Link to comment https://forums.phpfreaks.com/topic/89406-gdphp-image-display-bugerror/ Share on other sites More sharing options...
NeoMarine Posted February 4, 2008 Author Share Posted February 4, 2008 I forgot to mention, here is the script mine is based off: http://www.codewalkers.com/c/a/Miscellaneous/Overlapping-Images-with-GD/1/ The only thing different is I combine more than one image in mine... but i've tried combining just two and the error still occurs so thats not relevant. Quote Link to comment https://forums.phpfreaks.com/topic/89406-gdphp-image-display-bugerror/#findComment-457835 Share on other sites More sharing options...
PFMaBiSmAd Posted February 4, 2008 Share Posted February 4, 2008 It sounds like a memory problem and errors in the script when the browser makes two simultaneous requests back to the web server and two instances of getimage.php are created. Add the following line after the first opening <?php tag, execute the code, and then check your web server log for errors - error_reporting(E_ALL); Quote Link to comment https://forums.phpfreaks.com/topic/89406-gdphp-image-display-bugerror/#findComment-457842 Share on other sites More sharing options...
NeoMarine Posted February 4, 2008 Author Share Posted February 4, 2008 I checked, there are no errors in the error log... I tried E_ALL also... no errors. Here is what the images are coming back like: Anyone have ideas why this is happening? I even tried saving the images with: imagegif($image, $image_path); And in my $image_path the images are saving, but they are still all messed up... Quote Link to comment https://forums.phpfreaks.com/topic/89406-gdphp-image-display-bugerror/#findComment-457856 Share on other sites More sharing options...
PFMaBiSmAd Posted February 4, 2008 Share Posted February 4, 2008 Seeing your actual code would help in case it is doing something while retrieving the information or generating the images. Quote Link to comment https://forums.phpfreaks.com/topic/89406-gdphp-image-display-bugerror/#findComment-457869 Share on other sites More sharing options...
NeoMarine Posted February 4, 2008 Author Share Posted February 4, 2008 Ok, I've been breaking the code down trying to find the problem but I have nothing left to remove really.... and the problem still exists: getimage.php = <?php //Display image type as gif header ("Content-type: image/gif"); // Name of image header('Content-Disposition: attachment; filename="abc"'); if ($_GET['ID']==1){ $image = imagecreatefromgif("images/characters/base/male1.gif"); } else { $image = imagecreatefromgif("images/characters/hair/male1_bluehair.gif"); } imagegif($image); imagedestroy($image); ?> On the page where I am using this script I have simply: <img src="getimage.php?ID=1" /> <img src="getimage.php?ID=2" /> And the images are returning just like they do above... all messed up! Quote Link to comment https://forums.phpfreaks.com/topic/89406-gdphp-image-display-bugerror/#findComment-457882 Share on other sites More sharing options...
NeoMarine Posted February 4, 2008 Author Share Posted February 4, 2008 When working with PNG images, THE PROBLEM IS RESOLVED... HOWEVER, obviously this is no good because I want to use GIF not PNG... retarded bug... anyone know the solution? its driving me crazy Quote Link to comment https://forums.phpfreaks.com/topic/89406-gdphp-image-display-bugerror/#findComment-457901 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.