Imagick::setImagePage

(PECL imagick 2, PECL imagick 3)

Imagick::setImagePageSets the page geometry of the image

Description

public Imagick::setImagePage(
    int $width,
    int $height,
    int $x,
    int $y
): bool

Sets the page geometry of the image.

Parameters

width

height

x

y

Return Values

Returns true on success.

Errors/Exceptions

Throws ImagickException on error.

add a note

User Contributed Notes 1 note

up
2
Darren Burnhill
16 years ago
This would appear to be the equivalent of +repage in ImageMagick.

<?php
$ImagickObj
= new Imagick($sourceImagePath);
$ImagickObj->cropImage($_POST['w'], $_POST['h'], $_POST['x'], $_POST['y']);
$ImagickObj->setImagePage($_POST['w'], $_POST['h'], 0, 0);
$ImagickObj->writeImage($cropFilePath);
?>
To Top

Follow Lee on X/Twitter - Father, Husband, Serial builder creating AI, crypto, games & web tools. We are friends :) AI Will Come To Life!

Check out: eBank.nz (Art Generator) | Netwrck.com (AI Tools) | Text-Generator.io (AI API) | BitBank.nz (Crypto AI) | ReadingTime (Kids Reading) | RewordGame | BigMultiplayerChess | WebFiddle | How.nz | Helix AI Assistant