Jump to content

Gd image problem with Firefox


kickstart

Recommended Posts

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

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

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.

 

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.