PHP.mk документација

Imagick::getImagePage

Почист и полокален преглед на PHP референцата, со задржана структура од PHP.net и подобра читливост за примери, секции и белешки.

imagick.getimagepage.php PHP.net прокси Преводот се освежува
Оригинал на PHP.net
Патека imagick.getimagepage.php Локална патека за оваа страница.
Извор php.net/manual/en Оригиналниот HTML се реупотребува и локално се стилизира.
Режим Прокси + превод во позадина Кодовите, табелите и белешките остануваат читливи во истиот тек.
Imagick::getImagePage

Референца за `imagick.getimagepage.php` со подобрена типографија и навигација.

imagick.getimagepage.php

Imagick::getImagePage

(PECL imagick 2, PECL imagick 3)

Imagick::getImagePageReturns the page geometry

= NULL

public Imagick::getImagePage(): array

Returns the page geometry associated with the image in an array with the keys "width", "height", "x", and "y".

Параметри

Оваа функција нема параметри.

Вратени вредности

Returns the page geometry associated with the image in an array with the keys "width", "height", "x", and "y".

Errors/Exceptions

Фрла ImagickException при грешка.

Белешки од корисници 1 белешка

Keisial на gmail точка com
пред 13 години
The PHP function 'getImagePage' will return values indicating the height and width of an image, just like the getHeight and getWidth, except these values are returned as an array.  There's also two other values returned in the array with the key values of 'x' and 'y'.  After running this function on animated .Gif's, super-compressed jpeg's, bmp's, png's, and every type of awkward file format you could think of, I kept getting back the result of '0' for both the 'x' and 'y' associated values in the returned array.  It's likely that these indicate the "start-positions" of the width and height, compared to the "end-values" you receive for accessing the values associated with the keys 'width' and 'height'.

Oddly enough, the PHP function 'getPage' will return an array with the same exact keys, except the values all default to '0', making it much less useful than the function 'getImagePage'.

And some sample code :

<?php

            // Author: [email protected]
    
        // Imagick Type
        // ---------------------------------------------

    $imagick_type = new Imagick();
    
        // Open File
        // ---------------------------------------------
        
    $file_to_grab = "image_workshop_directory/test.gif";
    
    $file_handle_for_viewing_image_file = fopen($file_to_grab, 'a+');
    
        // Grab File
        // ---------------------------------------------

    $imagick_type->readImageFile($file_handle_for_viewing_image_file);
    
        // Get Image Page
        // ---------------------------------------------
        
    $image_page = $imagick_type->getImagePage();
    
        // Print Iteration Value Interpreted
        // ---------------------------------------------

    print_r($image_page);

?>

Expected Result :

Array
(
    [width] => 600
    [height] => 450
    [x] => 0
    [y] => 0
)
Навигација

Прелистувај сродни теми и функции.

На оваа страница

Автоматски outline од активната документација.

Насловите ќе се појават тука по вчитување.

Попрегледно читање

Примерите, changelog табелите и user notes се визуелно издвоени за да не се губат во долгата содржина.

Брз совет Користи го outline-от Скокни директно на главните секции од активната страница.
Извор Оригиналниот линк останува достапен Кога ти треба целосен upstream context, отвори го PHP.net во нов tab.