mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 00:48:54 +00:00
Add Rasmus' hint to use ImageType()
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@34121 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
9b53d281d7
commit
85c283be53
1 changed files with 32 additions and 3 deletions
|
@ -1067,15 +1067,15 @@ function LoadPNG ($imgname) {
|
|||
<informalexample>
|
||||
<programlisting role="php">
|
||||
<?php
|
||||
if(function_exists("imagegif")) {
|
||||
if (function_exists("imagegif")) {
|
||||
Header("Content-type: image/gif");
|
||||
ImageGif($im);
|
||||
}
|
||||
elseif(function_exists("imageJpeg")) {
|
||||
elseif (function_exists("imagejpeg")) {
|
||||
Header("Content-type: image/jpeg");
|
||||
ImageJpeg($im, "", 0.5);
|
||||
}
|
||||
elseif(function_exists("imagePng")) {
|
||||
elseif (function_exists("imagepng")) {
|
||||
Header("Content-type: image/png");
|
||||
ImagePng($im);
|
||||
}
|
||||
|
@ -1086,6 +1086,27 @@ function LoadPNG ($imgname) {
|
|||
</informalexample>
|
||||
</para>
|
||||
</note>
|
||||
<note>
|
||||
<para>
|
||||
In PHP4 as of version 4.0.2 you can use the function
|
||||
<function>imagetypes</function> in place of
|
||||
<function>function_exists</function> for checking
|
||||
the presence of the various supported image formats:
|
||||
<informalexample>
|
||||
<programlisting role="php">
|
||||
if (ImageTypes() & IMG_GIF) {
|
||||
Header("Content-type: image/gif");
|
||||
ImageGif($im);
|
||||
}
|
||||
elseif (ImageTypes() & IMG_JPG) {
|
||||
... etc.</programlisting>
|
||||
</informalexample>
|
||||
</para>
|
||||
</note>
|
||||
</para>
|
||||
<para>
|
||||
See also <function>ImagePng</function>,
|
||||
<function>ImageJpeg</function>, <function>ImageTypes</function>.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
@ -1122,6 +1143,10 @@ ImagePng($im);
|
|||
</programlisting>
|
||||
</informalexample>
|
||||
</para>
|
||||
<para>
|
||||
See also <function>ImageGif</function>,
|
||||
<function>ImageJpeg</function>, <function>ImageTypes</function>.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
|
@ -1164,6 +1189,10 @@ ImagePng($im);
|
|||
</para>
|
||||
</note>
|
||||
</para>
|
||||
<para>
|
||||
See also <function>ImagePng</function>,
|
||||
<function>ImageGif</function>, <function>ImageTypes</function>.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
|
|
Loading…
Reference in a new issue