note 54100 added to function.imagegif
| From: | LauriHarpf at osu1 dot php dot net | Date: | Thu, 23 Jun 2005 16:25:24 +0000 |
| Subject: | note 54100 added to function.imagegif | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-90849@lists.php.net to get a copy of this message | ||
Using <IMG SRC="image.php"> to dynamically generate images is a bit problematic
regarding cache. Unless caching is activated, IE seems to get confused about the type of the image
when attempting to save it. A .GIF created in the above way causes the browser to suggest saving the
image with .BMP, not .GIF.
A solution is to activate cache with session_cache_limiter('public'); in
"image.php", after which IE will correctly save as .GIF. If you do not want the cache to
block any changes in the dynamic image, make sure that the SRC keeps changing with every reload.
Something like "image.php/" . mt_rand(1,100000) . ".gif" seems to work well.
Might be trivial to some, but I spent a couple of hours figuring out why IE always wants to save my
dynamic .GIF's as .BMP's.
----
Manual Page -- http://www.php.net/manual/en/function.imagegif.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+54100
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+54100&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+54100&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+54100&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+54100&report=yes&reason=useless
Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+54100&report=yes&reason=non-english
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+54100&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+54100&report=yes
Search -- http://master.php.net/manage/user-notes.php