kickstart Posted January 7, 2010 Share Posted January 7, 2010 Hi I am not sure if this is a php, apache, Firefox or Javascript issue. I have a noddy script that generates an image of some text turned through 90 degrees. Used as a column header on some tables. I have a page that has many table cells which can be updated using javascript. The updated details are sent to the server using Ajax (the users want something that is fast, so doesn't require full page reloads). Depending on the table cell data there are column percentages (ie, percentage pass), so these are updated when a cell is updated, and are updated with the sideways image of the percentage text. This works fine in Opera, IE and Chrome. However Firefox doesn't always get the image and just leaves the alt text instead. If you do a page refresh the chances are it will bring back the images it failed to display before, but often then not display an image that was previously displayed. I have tried to make sure the gd images are not cached (although if it would display them I would rather they were cached), but it appears to have made no difference (other than making updates take far longer to refresh the page). Any suggestions? All the best Keith Link to comment https://forums.phpfreaks.com/topic/187562-gd-image-problem-with-firefox/ Share on other sites More sharing options...
crabfinger Posted January 7, 2010 Share Posted January 7, 2010 Firefox stores images in cache so it doesn't have to load them again. In the URI you use to load the image do you use a query string or what? Link to comment https://forums.phpfreaks.com/topic/187562-gd-image-problem-with-firefox/#findComment-990354 Share on other sites More sharing options...
teamatomic Posted January 7, 2010 Share Posted January 7, 2010 If you generate the image for each page load then maybe giving it a random name would help. HTH Teamatomic Link to comment https://forums.phpfreaks.com/topic/187562-gd-image-problem-with-firefox/#findComment-990373 Share on other sites More sharing options...
kickstart Posted January 7, 2010 Author Share Posted January 7, 2010 Hi I am quite happy for it to cache them, but not sure if it is some caching issue that prevents them being displayed. The image source will be something like SideWaysTextImage.php?InText=50% . This generates the image if required (and caches it on the server for future use anyway). I have tried adding the date / time to the end of the URL to make it unique but that hasn't helped (just slowed the page down by having to load up the images every time). Just not sure what the issue is, whether it is caching or not. All the best Keith Link to comment https://forums.phpfreaks.com/topic/187562-gd-image-problem-with-firefox/#findComment-990437 Share on other sites More sharing options...
crabfinger Posted January 7, 2010 Share Posted January 7, 2010 Hi I am quite happy for it to cache them, but not sure if it is some caching issue that prevents them being displayed. The image source will be something like SideWaysTextImage.php?InText=50% . This generates the image if required (and caches it on the server for future use anyway). I have tried adding the date / time to the end of the URL to make it unique but that hasn't helped (just slowed the page down by having to load up the images every time). Just not sure what the issue is, whether it is caching or not. All the best Keith you could use a .htaccess file in your root directory like this RewriteEngine on RewriteRule ^/(.+)\.jpg$ path/to/SideWaysTextImage.php?InText=$1 that way it will look like text.jpg but will render the same but you won't have to worry about the cache having a problem with it. Link to comment https://forums.phpfreaks.com/topic/187562-gd-image-problem-with-firefox/#findComment-990465 Share on other sites More sharing options...
kickstart Posted January 7, 2010 Author Share Posted January 7, 2010 Hi Not being hot on .htaccess, what is that trying to do? All the best Keith Link to comment https://forums.phpfreaks.com/topic/187562-gd-image-problem-with-firefox/#findComment-990482 Share on other sites More sharing options...
crabfinger Posted January 7, 2010 Share Posted January 7, 2010 Hi Not being hot on .htaccess, what is that trying to do? All the best Keith Sorry I gave you the wrong code, here it is with a slight modification. RewriteEngine on RewriteRule ^/SideWaysTextImage/(.+)\.jpg$ path/to/SideWaysTextImage.php?InText=$1 all that does is redirect all requests for something like http://www.yoursite.com/SideWaysTextImage/sometext.jpg to http://www.yoursite.com/SideWaysTextImage.php?InText=sometext but your browser doesn't think anything of it, all the browser will ever see for the uri is http://www.yoursite.com/SideWaysTextImage/sometext.jpg Link to comment https://forums.phpfreaks.com/topic/187562-gd-image-problem-with-firefox/#findComment-990671 Share on other sites More sharing options...
kickstart Posted January 8, 2010 Author Share Posted January 8, 2010 Hi Thanks and interesting, but unfortunately I am getting an internal server error with that .htaccess file. All the best Keith Link to comment https://forums.phpfreaks.com/topic/187562-gd-image-problem-with-firefox/#findComment-991063 Share on other sites More sharing options...
crabfinger Posted January 8, 2010 Share Posted January 8, 2010 Did you modify it so that it pointed to your file? and what error are you getting? Link to comment https://forums.phpfreaks.com/topic/187562-gd-image-problem-with-firefox/#findComment-991083 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.