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

search for in the

Imagick::cropThumbnailImage> <Imagick::convolveImage
Last updated: Fri, 20 May 2011

view this page in

Imagick::cropImage

(PECL imagick 2.0.0)

Imagick::cropImageExtrae una región de la imagen

Descripción

bool Imagick::cropImage ( int $width , int $height , int $x , int $y )
Warning

Esta función no está documentada actualmente, solamente se encuentra disponible la lista de parámetros.

Extrae una región de la imagen.

Parámetros

width

El ancho del recorte

height

El alto del recorte

x

La coordenada X de la esquina superior izquierda de la región recortada

y

La coordenada Y de la esquina superior izquierda de la región recortada

Valores devueltos

Devuelve TRUE en caso de éxito.

Errores/Excepciones

Lanza ImagickException en caso de error.



Imagick::cropThumbnailImage> <Imagick::convolveImage
Last updated: Fri, 20 May 2011
 
add a note add a note User Contributed Notes Imagick::cropImage
ElPadre 05-Nov-2010 04:55
Actually, the Imagick::setImagePage(0,0,0,0) is also handy with jpgs and pngs, if you plan to do any more changes on the cropped image that involves positioning and/or gravity (I created a script that does crop, face blur and watermarking in one go, and had a hell of a time determining why the blurs and the watermark text never showed up...).
Christian Dehning 09-Apr-2010 10:57
When cropping gif-images (I had no problems with jpg and png images), the canvas is not removed. Please run the following command on the cropped gif, to remove the blank space:

$im->setImagePage(0, 0, 0, 0);
vincent dot hoen at gmail dot com 02-Aug-2007 01:35
There is an easiest way to crop an image : 

$picture = new Imagick('animated_gif.gif');

foreach($picture as $frame){
    $frame->cropImage($width, $height, $x, $y);
}
vincent dot hoen at gmail dot com 01-Aug-2007 03:39
If you're working with animated gif you might want to process this way (Probably not the best, but at least it works) :

$picture = new Imagick('animated_gif.gif');

//Crop first image
$picture->cropImage($width, $height, $x, $y);

//Crop every other image
while($picture->hasNextImage()){
    $this->nextImage();
    $this->cropImage($width, $height, $x, $y);
}

//display image
$picture->getImageBlob();

 
show source | credits | stats | sitemap | contact | advertising | mirror sites