Contributions are ready for review

From: Date: Mon, 21 Oct 2013 12:00:02 +0000
Subject: Contributions are ready for review
Groups: php.doc 
Request: Send a blank email to phpdoc+get-969384695@lists.php.net to get a copy of this message
Hello PHP EN Documentation team, There are contributions within the online editor queue for this language. Please review, then commit or delete these patches. Patches for review : ----------------------- Modified: en/reference/imagick/imagickpixel/sethsl.xml By: anonymous on 2013-10-17 04:33:44 =================================================================== --- en/reference/imagick/imagickpixel/sethsl.xml +++ en/reference/imagick/imagickpixel/sethsl.xml @@ -14,7 +14,6 @@ <methodparam><type>float</type><parameter>saturation</parameter></methodparam> <methodparam><type>float</type><parameter>luminosity</parameter></methodparam> </methodsynopsis> - &warn.undocumented.func; <para> Sets the color described by the ImagickPixel object using normalized values for hue, saturation and luminosity. @@ -63,6 +62,54 @@ </para> </refsect1> + <refsect1 role="examples"> + &reftitle.examples; + <para> + +<example> + <title>Use <function>ImagickPixel::setHSL</function> to modify a color</title> + <programlisting role="php"> + <![CDATA[ +<?php + +//Create an almost pure red color +$color = new ImagickPixel('rgb(90%, 10%, 10%)'); + +//Get it's HSL values +$colorInfo = $color->getHSL(); + +//Rotate the hue by 180 degrees +$newHue = $colorInfo['hue'] + 0.5; +if ($newHue > 1) { + $newHue = $newHue - 1; +} + +//Set the ImagickPixel to the new color +$colorInfo = $color->setHSL($newHue, $colorInfo['saturation'], $colorInfo['luminosity']); + +//Check that the new color is blue/green +$colorInfo = $color->getcolor(); +print_r($colorInfo); + +?> + ]]> + </programlisting> + &example.outputs; + <screen> +<![CDATA[ +Array +( + [r] => 26 + [g] => 230 + [b] => 230 + [a] => 255 +) +]]> + </screen> +</example> +</para> +</refsect1> + <refsect1 role="notes"> &reftitle.notes; <note> => Put this change into your patches : https://edit.php.net/?project=php&action=putIntoMyPatches&idDB=50649 => Delete this change: https://edit.php.net/?project=php&action=deleteThisChange&idDB=50649 ------------------------------------------------------------------ Modified: en/reference/imagick/imagickpixel/gethsl.xml By: anonymous on 2013-10-17 05:00:23 =================================================================== --- en/reference/imagick/imagickpixel/gethsl.xml +++ en/reference/imagick/imagickpixel/gethsl.xml @@ -12,7 +12,6 @@ <type>array</type><methodname>ImagickPixel::getHSL</methodname> <void/> </methodsynopsis> - &warn.undocumented.func; <para> Returns the normalized HSL color described by the ImagickPixel object, with each of the three values as floating point numbers between 0.0 @@ -27,6 +26,38 @@ "saturation", and "luminosity". Throws ImagickPixelException on failure. </para> </refsect1> + + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title>Basic <function>Imagick::getHSL</function> example</title> + <programlisting role="php"> + <![CDATA[ +<?php + +$color = new ImagickPixel('rgb(90%, 10%, 10%)'); + +$colorInfo = $color->getHSL(); + +print_r($colorInfo); +?> + ]]> + </programlisting> + &example.outputs; + <screen> + <![CDATA[ +Array +( + [hue] => 0 + [saturation] => 0.80001220740379 + [luminosity] => 0.50000762951095 +) + ]]> + </screen> + </example> + </para> +</refsect1> <refsect1 role="notes"> &reftitle.notes; => Put this change into your patches : https://edit.php.net/?project=php&action=putIntoMyPatches&idDB=50650 => Delete this change: https://edit.php.net/?project=php&action=deleteThisChange&idDB=50650 ------------------------------------------------------------------ Modified: en/reference/imagick/imagickpixel/getcolor.xml By: anonymous on 2013-10-17 05:34:58 =================================================================== --- en/reference/imagick/imagickpixel/getcolor.xml +++ en/reference/imagick/imagickpixel/getcolor.xml @@ -12,7 +12,6 @@ <type>array</type><methodname>ImagickPixel::getColor</methodname> <methodparam choice="opt"><type>bool</type><parameter>normalized</parameter><initializer>false</initializer></methodparam> </methodsynopsis> - &warn.undocumented.func; <para> Returns the color described by the ImagickPixel object, as an array. If the color has an opacity channel set, this is provided as a fourth value in the list. @@ -35,6 +34,7 @@ </para> </refsect1> + <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> @@ -43,6 +43,59 @@ </para> </refsect1> + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title>Basic <function>Imagick::getColor</function> usage</title> + <programlisting role="php"> +<![CDATA[ +<?php + +//Create an ImagickPixel with the predefined color 'brown' +$color = new ImagickPixel('brown'); + +//Set the color to have an alpha of 25% +$color->setColorValue(Imagick::COLOR_ALPHA, 64 / 256.0); + +$colorInfo = $color->getColor(); + +echo "Standard values".PHP_EOL; +print_r($colorInfo); + +$colorInfo = $color->getColor(true); + +echo "Normalized values:".PHP_EOL; +print_r($colorInfo); + +?> +]]> + </programlisting> + &example.outputs; + <screen> + <![CDATA[ +Standard values +Array +( + [r] => 165 + [g] => 42 + [b] => 42 + [a] => 0 +) +Normalized values: +Array +( + [r] => 0.64705882352941 + [g] => 0.16470588235294 + [b] => 0.16470588235294 + [a] => 0.25000381475547 +) + ]]> + </screen> + </example> + </para> +</refsect1> + </refentry> <!-- Keep this comment at the end of the file => Put this change into your patches : https://edit.php.net/?project=php&action=putIntoMyPatches&idDB=50651 => Delete this change: https://edit.php.net/?project=php&action=deleteThisChange&idDB=50651 ------------------------------------------------------------------ Modified: en/reference/imagick/imagickpixel/getcolorasstring.xml By: anonymous on 2013-10-17 05:46:05 =================================================================== --- en/reference/imagick/imagickpixel/getcolorasstring.xml +++ en/reference/imagick/imagickpixel/getcolorasstring.xml @@ -12,25 +12,58 @@ <type>string</type><methodname>ImagickPixel::getColorAsString</methodname> <void/> </methodsynopsis> - &warn.undocumented.func; <para> Returns the color of the ImagickPixel object as a string. </para> </refsect1> - <refsect1 role="parameters"> - &reftitle.parameters; - <para> - </para> - </refsect1> - <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> Returns the color of the ImagickPixel object as a string. </para> </refsect1> + + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title>Basic <function>Imagick::getColorAsString</function> usage</title> + <programlisting role="php"> +<![CDATA[ +<?php +//Create an ImagickPixel with the predefined color 'brown' +$color = new ImagickPixel('brown'); + +$color->setColorValue(Imagick::COLOR_ALPHA, 64 / 256.0); +$colorInfo = $color->getColorAsString(); + +print_r($colorInfo); +?> +]]> + </programlisting> + &example.outputs; + <screen> +<![CDATA[ +rgb(165,42,42) +]]> + </screen> + </example> + </para> + </refsect1> + + <refsect1 role="notes"> + &reftitle.notes; + <note> + <title>Alpha not returned</title> + <para> + This function does not return the alpha value of the color in the string. + </para> + </note> + </refsect1> + + </refentry> <!-- Keep this comment at the end of the file => Put this change into your patches : https://edit.php.net/?project=php&action=putIntoMyPatches&idDB=50652 => Delete this change: https://edit.php.net/?project=php&action=deleteThisChange&idDB=50652 ------------------------------------------------------------------ Modified: en/reference/imagick/imagickpixel/getcolorvalue.xml By: anonymous on 2013-10-17 06:18:25 =================================================================== --- en/reference/imagick/imagickpixel/getcolorvalue.xml +++ en/reference/imagick/imagickpixel/getcolorvalue.xml @@ -12,7 +12,6 @@ <type>float</type><methodname>ImagickPixel::getColorValue</methodname> <methodparam><type>int</type><parameter>color</parameter></methodparam> </methodsynopsis> - &warn.undocumented.func; <para> Retrieves the value of the color channel specified, as a floating-point number between 0 and 1. @@ -27,7 +26,10 @@ <term><parameter>color</parameter></term> <listitem> <para> - The channel to check, specified as one of the Imagick channel constants. + The color to get the value of, specified as one of the Imagick + color constants. This can be one of the RGB colors, CMYK + colors, alpha and opacity e.g (Imagick::COLOR_BLUE, + Imagick::COLOR_MAGENTA). </para> </listitem> </varlistentry> @@ -42,6 +44,53 @@ ImagickPixelException on error. </para> </refsect1> + + + +<refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title>Basic <function>Imagick::getColorValue</function> usage</title> + <programlisting role="php"> +<![CDATA[ +<?php + +$color = new ImagickPixel('rgba(90%, 20%, 20%, 0.75)'); + +echo "Alpha value is ".$color->getColorValue(Imagick::COLOR_ALPHA).PHP_EOL; +echo "".PHP_EOL; +echo "Red value is ".$color->getColorValue(Imagick::COLOR_RED).PHP_EOL; +echo "Green value is ".$color->getColorValue(Imagick::COLOR_GREEN).PHP_EOL; +echo "Blue value is ".$color->getColorValue(Imagick::COLOR_BLUE).PHP_EOL; +echo "".PHP_EOL; +echo "Cyan value is ".$color->getColorValue(Imagick::COLOR_CYAN).PHP_EOL; +echo "Magenta value is ".$color->getColorValue(Imagick::COLOR_MAGENTA).PHP_EOL; +echo "Yellow value is ".$color->getColorValue(Imagick::COLOR_YELLOW).PHP_EOL; +echo "Black value is ".$color->getColorValue(Imagick::COLOR_BLACK).PHP_EOL; + +?> +]]> + </programlisting> + &example.outputs; + <screen> +<![CDATA[ +Alpha value is 0.74999618524453 + +Red value is 0.90000762951095 +Green value is 0.2 +Blue value is 0.2 + +Cyan value is 0.90000762951095 +Magenta value is 0.2 +Yellow value is 0.2 +Black value is 0 +]]> + </screen> + </example> + </para> + </refsect1> + </refentry> => Put this change into your patches : https://edit.php.net/?project=php&action=putIntoMyPatches&idDB=50653 => Delete this change: https://edit.php.net/?project=php&action=deleteThisChange&idDB=50653 ------------------------------------------------------------------ Modified: en/reference/imagick/imagickpixel/setcolorvalue.xml By: anonymous on 2013-10-17 06:44:09 =================================================================== --- en/reference/imagick/imagickpixel/setcolorvalue.xml +++ en/reference/imagick/imagickpixel/setcolorvalue.xml @@ -13,7 +13,7 @@ <methodparam><type>int</type><parameter>color</parameter></methodparam> <methodparam><type>float</type><parameter>value</parameter></methodparam> </methodsynopsis> - &warn.undocumented.func; + <para> Sets the value of the specified channel of this object to the provided value, which should be between 0 and 1. This function can be used to @@ -52,6 +52,40 @@ </para> </refsect1> +<refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title>Basic <function>Imagick::setColorValue</function> usage</title> + <programlisting role="php"> +<![CDATA[ +<?php + +$color = new ImagickPixel('firebrick'); + +$color->setColorValue(Imagick::COLOR_ALPHA, 0.5); + +print_r($color->getcolor(true)); +?> +]]> + </programlisting> + &example.outputs; + <screen> +<![CDATA[ +Array +( + [r] => 0.69803921568627 + [g] => 0.13333333333333 + [b] => 0.13333333333333 + [a] => 0.50000762951095 +) +]]> + </screen> + </example> + </para> + </refsect1> + + </refentry> <!-- Keep this comment at the end of the file => Put this change into your patches : https://edit.php.net/?project=php&action=putIntoMyPatches&idDB=50658 => Delete this change: https://edit.php.net/?project=php&action=deleteThisChange&idDB=50658 ------------------------------------------------------------------ Modified: en/reference/imagick/imagick/setimageiterations.xml By: anonymous on 2013-10-19 08:20:13 =================================================================== --- en/reference/imagick/imagick/setimageiterations.xml +++ en/reference/imagick/imagick/setimageiterations.xml @@ -13,7 +13,7 @@ <methodparam><type>int</type><parameter>iterations</parameter></methodparam> </methodsynopsis> <para> - Sets the image iterations. + Sets the number of iterations an animated image is repeated. </para> </refsect1> @@ -25,6 +25,7 @@ <term><parameter>iterations</parameter></term> <listitem> <para> + The number of iterations the image should loop over. Set to '0' to loop continuously. </para> </listitem> </varlistentry> @@ -45,6 +46,30 @@ &imagick.imagick.throws; </para> </refsect1> + + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title>Basic <function>Imagick::setImageIterations</function> usage</title> + <programlisting role="php"> +<![CDATA[ +<?php +$imagick = new Imagick(realpath("Test.gif")); + +$imagick = $imagick->coalesceImages(); +$imagick->setImageIterations(1); +$imagick = $imagick->deconstructImages(); + +$imagick->writeImages('/path/to/save/OnceOnly.gif', true); + +?> +]]> +</programlisting> + +</example> +</para> +</refsect1> </refentry> => Put this change into your patches : https://edit.php.net/?project=php&action=putIntoMyPatches&idDB=50662 => Delete this change: https://edit.php.net/?project=php&action=deleteThisChange&idDB=50662 ------------------------------------------------------------------ Modified: en/reference/imagick/imagick/setimagetickspersecond.xml By: anonymous on 2013-10-19 10:01:07 =================================================================== --- en/reference/imagick/imagick/setimagetickspersecond.xml +++ en/reference/imagick/imagick/setimagetickspersecond.xml @@ -10,11 +10,19 @@ &reftitle.description; <methodsynopsis> <type>bool</type><methodname>Imagick::setImageTicksPerSecond</methodname> - <methodparam><type>int</type><parameter>ticks_per-second</parameter></methodparam> + <methodparam><type>int</type><parameter>ticks_per_second</parameter></methodparam> </methodsynopsis> <para> - Sets the image ticks-per-second. + Adjust the amount of time that a frame of an animated image is displayed for. </para> + <note> + <para> + For animated GIFs, this function does not change the number of 'image ticks' per second, which is always defined as 100. Instead it adjusts the amount of time that the frame is displayed for to simulate the change in 'ticks per second'. + </para> + <para> + e.g If you have an animated GIF where each frame is displayed for 20 ticks (aka 1/5 of a second) and then called setImageTicksPerSecond(50) on each frame of that image, you are effectively asking Imagick to adjust those frames to be played at half speed. After the function call each frame would be displayed for 40 ticks (aka 2/5 of a second). + </para> + </note> </refsect1> <refsect1 role="parameters"> @@ -22,9 +30,10 @@ <para> <variablelist> <varlistentry> - <term><parameter>ticks_per-second</parameter></term> + <term><parameter>ticks_per_second</parameter></term> <listitem> <para> + The duration for which an image should be displayed expressed in ticks per second. </para> </listitem> </varlistentry> @@ -39,6 +48,52 @@ </para> </refsect1> + + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title>Modify animated Gif with <function>Imagick::setImageTicksPerSecond</function></title> + <programlisting role="php"> + <![CDATA[ +<?php + +//Modify an animated gif so the first half of the gif is played +//at half the speed it currently is, and the second half to be +//played at double the speed it currently is + +$imagick = new Imagick(realpath("Test.gif")); +$imagick = $imagick->coalesceImages(); + +$totalFrames = $imagick->getNumberImages(); + +$frameCount = 0; + +foreach ($imagick as $frame) { + + $imagick->setImageTicksPerSecond(50); + + if ($frameCount < ($totalFrames / 2)) { + //Modify the frame to be displayed for twice as long as it currently is. + $imagick->setImageTicksPerSecond(50); + } + else{ + //Modify the frame to be displayed for half as long as it currently is. + $imagick->setImageTicksPerSecond(200); + } + $frameCount++; +} + +$imagick = $imagick->deconstructImages(); + +$imagick->writeImages("/path/to/save/output.gif", true); +?> + ]]> + </programlisting> + </example> + </para> + </refsect1> + </refentry> <!-- Keep this comment at the end of the file => Put this change into your patches : https://edit.php.net/?project=php&action=putIntoMyPatches&idDB=50665 => Delete this change: https://edit.php.net/?project=php&action=deleteThisChange&idDB=50665 ------------------------------------------------------------------ Modified: en/reference/imagick/imagick/setimagedelay.xml By: anonymous on 2013-10-19 10:10:45 =================================================================== --- en/reference/imagick/imagick/setimagedelay.xml +++ en/reference/imagick/imagick/setimagedelay.xml @@ -13,7 +13,10 @@ <methodparam><type>int</type><parameter>delay</parameter></methodparam> </methodsynopsis> <para> - Sets the image delay. + Sets the image delay. For an animated image this is the amount of time that this frame of the image should be displayed for, before displaying the next frame. + </para> + <para> + The delay can be set individually for each frame in an image. </para> </refsect1> @@ -25,6 +28,7 @@ <term><parameter>delay</parameter></term> <listitem> <para> + The amount of time expressed in 'ticks' that the image should be displayed for. For animated GIFs there are 100 ticks per second, so a value of 20 would be 20/100 of a second aka 1/5th of a second. </para> </listitem> </varlistentry> @@ -45,6 +49,40 @@ &imagick.imagick.throws; </para> </refsect1> + + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title>Modify animated Gif with <function>Imagick::setImageDelay</function></title> + <programlisting role="php"> +<![CDATA[ +<?php +//Modify an animated Gif so that it's frames are played at +//a variable speed, varying between being shown for 50milliseconds +//down to 0ms, which will cause the frame to be skipped in +//most browsers. +$imagick = new Imagick(realpath("Test.gif")); +$imagick = $imagick->coalesceImages(); + +$frameCount = 0; + +foreach ($imagick as $frame) { + $imagick->setImageDelay((($frameCount % 11) * 5)); + $frameCount++; +} + +$imagick = $imagick->deconstructImages(); + +$imagick->writeImages("/path/to/save/output.gif", true); + +?> +]]> + </programlisting> + </example> + </para> +</refsect1> + </refentry> => Put this change into your patches : https://edit.php.net/?project=php&action=putIntoMyPatches&idDB=50666 => Delete this change: https://edit.php.net/?project=php&action=deleteThisChange&idDB=50666 ------------------------------------------------------------------ Modified: en/reference/imagick/imagick/getquantumdepth.xml By: anonymous on 2013-10-20 03:46:03 =================================================================== --- en/reference/imagick/imagick/getquantumdepth.xml +++ en/reference/imagick/imagick/getquantumdepth.xml @@ -9,7 +9,9 @@ <refsect1 role="description"> &reftitle.description; <methodsynopsis> - <type>array</type><methodname>Imagick::getQuantumDepth</methodname> + <modifier>static</modifier> + <type>array</type> + <methodname>Imagick::getQuantumDepth</methodname> <void/> </methodsynopsis> <para> => Put this change into your patches : https://edit.php.net/?project=php&action=putIntoMyPatches&idDB=50668 => Delete this change: https://edit.php.net/?project=php&action=deleteThisChange&idDB=50668 ------------------------------------------------------------------ Modified: en/reference/imagick/imagick/getquantumrange.xml By: anonymous on 2013-10-20 03:50:10 =================================================================== --- en/reference/imagick/imagick/getquantumrange.xml +++ en/reference/imagick/imagick/getquantumrange.xml @@ -9,7 +9,9 @@ <refsect1 role="description"> &reftitle.description; <methodsynopsis> - <type>array</type><methodname>Imagick::getQuantumRange</methodname> + <modifier>static</modifier> + <type>array</type> + <methodname>Imagick::getQuantumRange</methodname> <void/> </methodsynopsis> <para> => Put this change into your patches : https://edit.php.net/?project=php&action=putIntoMyPatches&idDB=50669 => Delete this change: https://edit.php.net/?project=php&action=deleteThisChange&idDB=50669 ------------------------------------------------------------------ Modified: en/reference/imagick/imagick/getreleasedate.xml By: anonymous on 2013-10-20 03:51:38 =================================================================== --- en/reference/imagick/imagick/getreleasedate.xml +++ en/reference/imagick/imagick/getreleasedate.xml @@ -9,7 +9,9 @@ <refsect1 role="description"> &reftitle.description; <methodsynopsis> - <type>string</type><methodname>Imagick::getReleaseDate</methodname> + <modifier>static</modifier> + <type>string</type> + <methodname>Imagick::getReleaseDate</methodname> <void/> </methodsynopsis> <para> => Put this change into your patches : https://edit.php.net/?project=php&action=putIntoMyPatches&idDB=50670 => Delete this change: https://edit.php.net/?project=php&action=deleteThisChange&idDB=50670 ------------------------------------------------------------------ Modified: en/reference/imagick/imagick/getversion.xml By: anonymous on 2013-10-20 03:52:15 =================================================================== --- en/reference/imagick/imagick/getversion.xml +++ en/reference/imagick/imagick/getversion.xml @@ -9,7 +9,9 @@ <refsect1 role="description"> &reftitle.description; <methodsynopsis> - <type>array</type><methodname>Imagick::getVersion</methodname> + <modifier>static</modifier> + <type>array</type> + <methodname>Imagick::getVersion</methodname> <void/> </methodsynopsis> <para> => Put this change into your patches : https://edit.php.net/?project=php&action=putIntoMyPatches&idDB=50671 => Delete this change: https://edit.php.net/?project=php&action=deleteThisChange&idDB=50671 ------------------------------------------------------------------ Modified: en/reference/imagick/imagick/getpackagename.xml By: anonymous on 2013-10-20 03:52:42 =================================================================== --- en/reference/imagick/imagick/getpackagename.xml +++ en/reference/imagick/imagick/getpackagename.xml @@ -9,7 +9,9 @@ <refsect1 role="description"> &reftitle.description; <methodsynopsis> - <type>string</type><methodname>Imagick::getPackageName</methodname> + <modifier>static</modifier> + <type>string</type> + <methodname>Imagick::getPackageName</methodname> <void/> </methodsynopsis> <para> => Put this change into your patches : https://edit.php.net/?project=php&action=putIntoMyPatches&idDB=50672 => Delete this change: https://edit.php.net/?project=php&action=deleteThisChange&idDB=50672 ------------------------------------------------------------------ Modified: en/reference/imagick/imagick/gethomeurl.xml By: anonymous on 2013-10-20 03:53:26 =================================================================== --- en/reference/imagick/imagick/gethomeurl.xml +++ en/reference/imagick/imagick/gethomeurl.xml @@ -9,7 +9,9 @@ <refsect1 role="description"> &reftitle.description; <methodsynopsis> - <type>string</type><methodname>Imagick::getHomeURL</methodname> + <modifier>static</modifier> + <type>string</type> + <methodname>Imagick::getHomeURL</methodname> <void/> </methodsynopsis> <para> => Put this change into your patches : https://edit.php.net/?project=php&action=putIntoMyPatches&idDB=50673 => Delete this change: https://edit.php.net/?project=php&action=deleteThisChange&idDB=50673 ------------------------------------------------------------------ Modified: en/reference/imagick/imagick/getcopyright.xml By: anonymous on 2013-10-20 03:53:47 =================================================================== --- en/reference/imagick/imagick/getcopyright.xml +++ en/reference/imagick/imagick/getcopyright.xml @@ -9,7 +9,9 @@ <refsect1 role="description"> &reftitle.description; <methodsynopsis> - <type>string</type><methodname>Imagick::getCopyright</methodname> + <modifier>static</modifier> + <type>string</type> + <methodname>Imagick::getCopyright</methodname> <void/> </methodsynopsis> <para> => Put this change into your patches : https://edit.php.net/?project=php&action=putIntoMyPatches&idDB=50674 => Delete this change: https://edit.php.net/?project=php&action=deleteThisChange&idDB=50674 ------------------------------------------------------------------ -- https://edit.php.net/ This email is send automatically by the Php Docbook Online Editor.

« previous php.doc (#969384695) next »