mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-30 15:58:55 +00:00

+ changed imagick's generic return entities to something more appropriate + added entities for throwing ImagickException, etc reference/imagick/imagick/adaptiveblurimage.xml and reference/imagick/imagick/adaptiveresizeimage.xml + fully documented + included an example + added error information + no longer marked undocumented + changed &warn.experimental; to &warn.experimental.func; reference/imagick/imagick/*.xml and reference/imagick/imagickdraw/*.xml and reference/imagick/imagickpixel/*.xml and reference/imagick/imagickpixeliterator/*.xml + changed &warn.experimental; to &warn.experimental.func; + changed &imagick.*.return.success to &imagick.return.success; git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@237612 c90b9560-bf6c-de11-be94-00142212c4b1
103 lines
2.4 KiB
XML
103 lines
2.4 KiB
XML
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
<!-- $Revision: 1.8 $ -->
|
|
<!-- Purpose: utilspec.image -->
|
|
<!-- Membership: pecl, external -->
|
|
<!-- State: experimental -->
|
|
<reference id="ref.imagick">
|
|
<title>Imagick Image Library</title>
|
|
<titleabbrev>Imagick Image Library</titleabbrev>
|
|
|
|
<partintro>
|
|
<section id="imagick.intro">
|
|
&reftitle.intro;
|
|
<para>
|
|
&warn.experimental;
|
|
Imagick is a native php extension to create and modify images using the
|
|
ImageMagick API.
|
|
</para>
|
|
</section>
|
|
|
|
<section id="imagick.examples">
|
|
&reftitle.examples;
|
|
<para>
|
|
Imagick makes image manipulation in PHP extremely easy through an OO
|
|
interface. Here is a quick example on how to make a thumbnail:
|
|
<example>
|
|
<title>Creating a thumbnail in Imagick</title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
|
|
header('Content-type: image/jpeg');
|
|
|
|
$image = new Imagick('image.jpg');
|
|
|
|
// If 0 is provided as a width or height parameter,
|
|
// aspect ratio is maintained
|
|
$image->thumbnailImage(100, 0);
|
|
|
|
echo $image;
|
|
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
</example>
|
|
</para>
|
|
|
|
<para>
|
|
Using SPL and other OO features supported in Imagick, it can be simple
|
|
to resize all files in a directory (useful for batch resizing large
|
|
digital camera images to be web viewable). Here we use resize, as we might
|
|
want to retain certain meta-data:
|
|
<example>
|
|
<title>Make a thumbnail of all JPG files in a directory</title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
|
|
$images = new Imagick(glob('images/*.JPG'));
|
|
|
|
foreach($images as $image) {
|
|
|
|
// Providing 0 forces resizeImage to maintain aspect ratio
|
|
$image->resizeImage(1024,0);
|
|
|
|
}
|
|
|
|
$images->writeImages();
|
|
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
</example>
|
|
</para>
|
|
</section>
|
|
</partintro>
|
|
&reference.imagick.constants;
|
|
&reference.imagick.install;
|
|
&reference.imagick.imagick;
|
|
&reference.imagick.imagickdraw;
|
|
&reference.imagick.imagickpixel;
|
|
&reference.imagick.imagickpixeliterator;
|
|
</reference>
|
|
|
|
<!-- 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
|
|
-->
|