mirror of
https://github.com/php/doc-es.git
synced 2026-03-26 08:22:08 +01:00
git-svn-id: https://svn.php.net/repository/phpdoc/es/trunk@337002 c90b9560-bf6c-de11-be94-00142212c4b1
206 lines
5.4 KiB
XML
206 lines
5.4 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- $Revision$ -->
|
|
<!-- EN-Revision: 966b269f4f98344498ba2d1e7a1dd3029e53d40c Maintainer: seros Status: ready -->
|
|
<!-- Reviewed: no -->
|
|
<refentry xml:id="function.imagejpeg" xmlns="http://docbook.org/ns/docbook">
|
|
<refnamediv>
|
|
<refname>imagejpeg</refname>
|
|
<refpurpose>&gd.image.output;</refpurpose>
|
|
</refnamediv>
|
|
<refsect1 role="description">
|
|
&reftitle.description;
|
|
<methodsynopsis>
|
|
<type>bool</type><methodname>imagejpeg</methodname>
|
|
<methodparam><type>resource</type><parameter>image</parameter></methodparam>
|
|
<methodparam choice="opt"><type>string</type><parameter>filename</parameter></methodparam>
|
|
<methodparam choice="opt"><type>int</type><parameter>quality</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
<function>imagejpeg</function> crea un archivo <acronym>JPEG</acronym> desde
|
|
<parameter>image</parameter>.
|
|
</para>
|
|
</refsect1>
|
|
<refsect1 role="parameters">
|
|
&reftitle.parameters;
|
|
<para>
|
|
<variablelist>
|
|
&gd.image.description;
|
|
<varlistentry>
|
|
<term><parameter>filename</parameter></term>
|
|
<listitem>
|
|
<para>&gd.image.path;</para>
|
|
<para>
|
|
Para saltarse este argumeto para proporcionar el
|
|
parámetro <parameter>quality</parameter>, use &null;.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>quality</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
<parameter>quality</parameter> es opcional, y su valor es desde 0 (peor
|
|
calidad, archivo más pequeño) a 100 (mejor calidad, archivo más grande). El valor
|
|
por defecto es el valor de calidad predeterminada de IJG (sobre 75).
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
</para>
|
|
</refsect1>
|
|
<refsect1 role="returnvalues">
|
|
&reftitle.returnvalues;
|
|
<para>
|
|
&return.success;
|
|
</para>
|
|
</refsect1>
|
|
<refsect1 role="examples">
|
|
&reftitle.examples;
|
|
<para>
|
|
<example>
|
|
<title>Imprimir una imagen JPEG</title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
// Crear una imagen en blanco y añadir algún texto
|
|
$im = imagecreatetruecolor(120, 20);
|
|
$color_texto = imagecolorallocate($im, 233, 14, 91);
|
|
imagestring($im, 1, 5, 5, 'A Simple Text String', $color_texto);
|
|
|
|
// Establecer la cabecera de tipo de contenido - en este caso image/jpeg
|
|
header('Content-Type: image/jpeg');
|
|
|
|
// Imprimir la imagen
|
|
imagejpeg($im);
|
|
|
|
// Liberar memoria
|
|
imagedestroy($im);
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
&example.outputs.similar;
|
|
<mediaobject>
|
|
<alt>Salida del ejemplo : Imprimir una imagen JPEG</alt>
|
|
<imageobject>
|
|
<imagedata fileref="en/reference/image/figures/imagejpeg.jpg"/>
|
|
</imageobject>
|
|
</mediaobject>
|
|
</example>
|
|
</para>
|
|
<para>
|
|
<example>
|
|
<title>Guardar una imagen JPEG</title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
// Crear una imagen en blanco y añadir algún texto
|
|
$im = imagecreatetruecolor(120, 20);
|
|
$color_texto = imagecolorallocate($im, 233, 14, 91);
|
|
imagestring($im, 1, 5, 5, 'Una Sencilla Cadena De Texto', $color_texto);
|
|
|
|
// Guardar la imagen como 'textosimple.jpg'
|
|
imagejpeg($im, 'textosimple.jpg');
|
|
|
|
// Liberar memoria
|
|
imagedestroy($im);
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
</example>
|
|
</para>
|
|
<para>
|
|
<example>
|
|
<title>Imprimir la imagen al 75% de calidad</title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
// Crear una imagen en blanco y añadir algún texto
|
|
$im = imagecreatetruecolor(120, 20);
|
|
$color_texto = imagecolorallocate($im, 233, 14, 91);
|
|
imagestring($im, 1, 5, 5, 'Una Sencilla Cadena De Texto', $color_texto);
|
|
|
|
// Establecer la cabecera de tipo de contenido - en este caso image/jpeg
|
|
header('Content-Type: image/jpeg');
|
|
|
|
// Saltarse el parámetro filename usando NULL, después establecer la calidad al 75%
|
|
imagejpeg($im, NULL, 75);
|
|
|
|
// Liberar memoria
|
|
imagedestroy($im);
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
</example>
|
|
</para>
|
|
</refsect1>
|
|
<refsect1 role="notes">
|
|
&reftitle.notes;
|
|
¬e.config.jpeg;
|
|
<note>
|
|
<para>
|
|
Si quiere imprimir imágenes JPEG Progresivas, necesita habilitar el entrelazamiento
|
|
con <function>imageinterlace</function>.
|
|
</para>
|
|
</note>
|
|
</refsect1>
|
|
|
|
<refsect1 role="changelog">
|
|
&reftitle.changelog;
|
|
<para>
|
|
<informaltable>
|
|
<tgroup cols="2">
|
|
<thead>
|
|
<row>
|
|
<entry>&Version;</entry>
|
|
<entry>&Description;</entry>
|
|
</row>
|
|
</thead>
|
|
<tbody>
|
|
<row>
|
|
<entry>5.4.0</entry>
|
|
<entry>
|
|
Se deshabilitó el paso de un string vacío a <parameter>filename</parameter> para
|
|
saltar este argumeto.
|
|
</entry>
|
|
</row>
|
|
</tbody>
|
|
</tgroup>
|
|
</informaltable>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="seealso">
|
|
&reftitle.seealso;
|
|
<para>
|
|
<simplelist>
|
|
<member><function>imagepng</function></member>
|
|
<member><function>imagegif</function></member>
|
|
<member><function>imagewbmp</function></member>
|
|
<member><function>imageinterlace</function></member>
|
|
<member><function>imagetypes</function></member>
|
|
</simplelist>
|
|
</para>
|
|
</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:"~/.phpdoc/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
|
|
-->
|