downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

Imagick::current> <Imagick::cropImage
Last updated: Fri, 14 Aug 2009

view this page in

Imagick::cropThumbnailImage

(PECL imagick 2.0.0)

Imagick::cropThumbnailImageCrée une miniature par retaillage

Description

bool Imagick::cropThumbnailImage ( int $width , int $height )
Avertissement

Cette fonction n'est pas documentée et seule la liste des arguments est disponible.

Crée une miniature de taille fixe, en réduisant sa taille pour en recadrant l'image autour du centre.

Liste de paramètres

width

La largeur de la miniature

height

La hauteur de la miniature

Valeurs de retour

Returns TRUE on success.

Erreurs / Exceptions

Lance une exception ImagickException si une erreur survient.



add a note add a note User Contributed Notes
Imagick::cropThumbnailImage
benford at bluhelix dot com
11-Jun-2009 11:14
I found a relevant posting complete with demo code at this site:
http://valokuva.org/?p=8

Sample code goes like this:
<?php
/* Read the image */
$im = new imagick( "test.png" );
/* create the thumbnail */
$im->cropThumbnailImage( 80, 80 );
/* Write to a file */
$im->writeImage( "th_80x80_test.png" );
?>

This is a specialization of the cropImage method. At a high level, this method will create a thumbnail of a given image, with the thumbnail sized at ($width, $height).

If the thumbnail does not match the aspect ratio of the source image, this is the method to use. The thumbnail will capture the entire image on the shorter edge of the source image (ie, vertical size on a landscape image). Then the thumbnail will be scaled down to meet your target height, while preserving the aspect ratio. Extra horizontal space that does not fit within the target $width will be cropped off evenly left and right.

As a result, the thumbnail is usually a good representation of the source image.
domenechs1 at yahoo dot es
03-Mar-2008 06:06
$image = new Imagick($path."test1.jpg");

$image->cropThumbnailImage(160,120); // Crop image and thumb

$image->writeImage($path."test1.jpg");

Imagick::current> <Imagick::cropImage
Last updated: Fri, 14 Aug 2009
 
 
show source | credits | sitemap | contact | advertising | mirror sites