note 20425 modified in function.imagegif by helly
| From: | helly@php.net | Date: | Fri, 29 Nov 2002 15:33:45 +0000 |
| Subject: | note 20425 modified in function.imagegif by helly | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-40117@lists.php.net to get a copy of this message | ||
The following information is incorrect.
Instead read RFC2557: http://www.ietf.org/rfc/rfc2557.txt
For handling inline images in email.
-marcus
I've been playing around with the "data" URL scheme as proposed by RFC 2937 which
states how to perform inline, bas64 encoded images. A number of browsers support this format from
some of my tests and would be an interesting way of removing overhead from multiple HTTP
connections. Basically, the IMG tag would be:
<IMG SRC="/-/data:image/gif;base64,R0lGODdhMAAwAPAAAAAAAP///ywAAAAAMAAw
AAAC8IyPqcvt3wCcDkiLc7C0qwyGHhSWpjQu5yqmCYsapyuvUUlvONmOZtfzgFz
ByTB10QgxOR0TqBQejhRNzOfkVJ+5YiUqrXF5Y5lKh/DeuNcP5yLWGsEbtLiOSp
a/TPg7JpJHxyendzWTBfX0cxOnKPjgBzi4diinWGdkF8kjdfnycQZXZeYGejmJl
ZeGl9i2icVqaNVailT6F5iJ90m6mvuTS4OK05M0vDk0Q4XUtwvKOzrcd3iq9uis
F81M1OIcR7lEewwcLp7tuNNkM3uNna3F2JQFo97Vriy/Xl4/f1cf5VWzXyym7PH hhx4dbgYKAAA7"
ALT="Larry">
Something like that. Note also that I start the URI with "/-/" before the rest of the data
scheme spec. If you don't start it with this, it won't work in a lot of the different
browsers I tested (such as IE). Note this is useful for very small images only (as most browsers
appear to have a limitation on the size of HTML element data of 1024). Browsers where this syntax
worked that I tested are the following:
IE 6.x (windows)
Mozilla 0.97+ (linux)
Opera 5, 6 (windows)
Netscape 4.7+ (mac, windows)
IE 5 (macintosh)
This should work for other image types as well, such as PNG. JPEG files aren't really suggested
(usually, these files are too large). BTW - there is no advantage to this method if the image will
appear more than ONCE in the page because you will be transmitting the same data multiple times as
opposed to just once (most browsers realize that already downloaded data that has multiple
references only requires one HTTP call).
Consider using this method if you want to make a single PHP program that outputs both text and an
image AND you want to make only on HTTP call. Cheers.
--was--
I've been playing around with the "data" URL scheme as proposed by RFC 2937 which
states how to perform inline, bas64 encoded images. A number of browsers support this format from
some of my tests and would be an interesting way of removing overhead from multiple HTTP
connections. Basically, the IMG tag would be:
<IMG SRC="/-/data:image/gif;base64,R0lGODdhMAAwAPAAAAAAAP///ywAAAAAMAAw
AAAC8IyPqcvt3wCcDkiLc7C0qwyGHhSWpjQu5yqmCYsapyuvUUlvONmOZtfzgFz
ByTB10QgxOR0TqBQejhRNzOfkVJ+5YiUqrXF5Y5lKh/DeuNcP5yLWGsEbtLiOSp
a/TPg7JpJHxyendzWTBfX0cxOnKPjgBzi4diinWGdkF8kjdfnycQZXZeYGejmJl
ZeGl9i2icVqaNVailT6F5iJ90m6mvuTS4OK05M0vDk0Q4XUtwvKOzrcd3iq9uis
F81M1OIcR7lEewwcLp7tuNNkM3uNna3F2JQFo97Vriy/Xl4/f1cf5VWzXyym7PH hhx4dbgYKAAA7"
ALT="Larry">
Something like that. Note also that I start the URI with "/-/" before the rest of the data
scheme spec. If you don't start it with this, it won't work in a lot of the different
browsers I tested (such as IE). Note this is useful for very small images only (as most browsers
appear to have a limitation on the size of HTML element data of 1024). Browsers where this syntax
worked that I tested are the following:
IE 6.x (windows)
Mozilla 0.97+ (linux)
Opera 5, 6 (windows)
Netscape 4.7+ (mac, windows)
IE 5 (macintosh)
This should work for other image types as well, such as PNG. JPEG files aren't really suggested
(usually, these files are too large). BTW - there is no advantage to this method if the image will
appear more than ONCE in the page because you will be transmitting the same data multiple times as
opposed to just once (most browsers realize that already downloaded data that has multiple
references only requires one HTTP call).
Consider using this method if you want to make a single PHP program that outputs both text and an
image AND you want to make only on HTTP call. Cheers.
http://www.php.net/manual/en/function.imagegif.php