Seidr Posted December 20, 2007 Share Posted December 20, 2007 Greetings, I've been re-designing my site and have come across a strange problem involving the display of images, generated from a PHP script in FireFox. Upon loading the url http://new.othala.co.uk/2/5 for the first time, the image ('Cellular') will load correctly with a forced max width of 800px. The image is created by PHP, opening a JPG file on the server-side, and outputting it through GD. Now when I hit reload, or navigate away from the page and return, all that is displayed is the ALT text, even though the definition of the image is valid, and the image will load when visited directly (http://new.othala.co.uk/image/5). This feels like a cache issue, but surely the cache would not cause the image to not display at all? If anyone can think what may be causing this strange error, your help would be appreciated. The only way I found to display the image was by appending a random digit to the request each time. While a solution to the problem, it would not be very friendly towards search engines, and I'm trying to keep this site as tidy as possible. I'm using mod_rewrite to redirect the request to my PHP script. Below is the rewrite rule, and the image script. RewriteRule ^image/([0-9^/\.]+)/?$ /includes/image.php?id=$1&full=1 [L] <?php include("DATABASEFILE"); $query = "SELECT * FROM <TABLE REMOVED> WHERE id=" . $_GET['id']; $results = mysql_query($query); $resultsArray = mysql_fetch_array($results); if (!$_GET['full']) { $path = "<PATH REMOVED>/tn_" . $resultsArray['filename']; } else { $path = "<PATH REMOVED>/" . $resultsArray['filename']; } header("Content-type: image/jpeg"); $img = imagecreatefromjpeg($path); imagejpeg($img); ?> Many thanks! James Quote Link to comment Share on other sites More sharing options...
thebadbad Posted December 20, 2007 Share Posted December 20, 2007 It's working fine here. It keeps displaying Quote Link to comment Share on other sites More sharing options...
Seidr Posted December 20, 2007 Author Share Posted December 20, 2007 It's working fine here. It keeps displaying Under FF 2.0.0.11? If so, very odd. Quote Link to comment Share on other sites More sharing options...
helraizer Posted December 20, 2007 Share Posted December 20, 2007 It works the same in both FF 2.0.0.11 and IE7 for me Quote Link to comment Share on other sites More sharing options...
Jessica Posted December 20, 2007 Share Posted December 20, 2007 It displays for me too, the version of firefox shouldn't be that big a deal. Did you accidentally block it in IE? Does it show in IE, Opera or Safari? The only way I have ever been able to do it is with appending the timestamp to the end. Quote Link to comment Share on other sites More sharing options...
Seidr Posted December 20, 2007 Author Share Posted December 20, 2007 It displays for me too, the version of firefox shouldn't be that big a deal. Did you accidentally block it in IE? Does it show in IE, Opera or Safari? The only way I have ever been able to do it is with appending the timestamp to the end. It works fien in IE, have not tried in Opera or Safari. It loads fine the first time I visit the page, but as I said as soon as I reload or refresh, all that is shown is the ALT tag. Perhaps FF needs to be reinstalled..unlikely, but I have no idea what else could be causing it! Quote Link to comment Share on other sites More sharing options...
Seidr Posted December 20, 2007 Author Share Posted December 20, 2007 It turns out that the FireFox Developer Toolbar was to blame, some how. Once disabled, the images are displayed properly. Very strange. Thanks for your help all the same! Quote Link to comment 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.