Files
doc-fr/reference/image/functions/imagecreatefromjpeg.xml
T
Yannick Torres 6ac241f9a5 sync with EN
git-svn-id: https://svn.php.net/repository/phpdoc/fr/trunk@187139 c90b9560-bf6c-de11-be94-00142212c4b1
2005-05-28 08:40:59 +00:00

80 lines
2.3 KiB
XML

<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.13 $ -->
<!-- EN-Revision: 1.9 Maintainer: yannick Status: ready -->
<!-- Reviewed: yes -->
<refentry id="function.imagecreatefromjpeg">
<refnamediv>
<refname>imagecreatefromjpeg</refname>
<refpurpose>
Crée une nouvelle image <acronym>JPEG</acronym>
à partir d'un fichier ou d'une URL
</refpurpose>
</refnamediv>
<refsect1>
&reftitle.description;
<methodsynopsis>
<type>resource</type><methodname>imagecreatefromjpeg</methodname>
<methodparam><type>string</type><parameter>filename</parameter></methodparam>
</methodsynopsis>
<para>
<function>imagecreatefromjpeg</function> retourne un identifiant d'image
représentant une image obtenue à partir du fichier
<parameter>filename</parameter>.
</para>
<para>
<function>imagecreatefromjpeg</function> retourne une chaîne vide en cas
d'échec. Elle affiche aussi un message d'erreur, qui est représenté comme un
lien brisé dans un navigateur web. Pour faciliter le débogage,
voici une erreur <acronym>JPEG</acronym>:
<example>
<title>
Exemple de gestion d'erreur lors de la création d'image
(gracieusement offert par vic@zymsys.com )
</title>
<programlisting role="php">
<![CDATA[
<?php
function loadjpeg($imgname) {
$im = @imagecreatefromjpeg($imgname); /* Tentative d'ouverture */
if (!$im) { /* Vérification */
$im = imagecreate(150, 30); /* Création d'une image blanche */
$bgc = imagecolorallocate($im, 255, 255, 255);
$tc = imagecolorallocate($im, 0, 0, 0);
imagefilledrectangle($im, 0, 0, 150, 30, $bgc);
// Affichage d'un message d'erreur
imagestring($im, 1, 5, 5, "Erreur de chargement de l'image $imgname", $tc);
}
return $im;
}
?>
]]>
</programlisting>
</example>
</para>
&note.config.jpeg;
&tip.fopen-wrapper;
&warn.no-win32-fopen-wrapper;
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"../../../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->