首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往

Imagick::getSize

(PECL imagick 2.0.0)

Imagick::getSize — Returns the size associated with the Imagick object

Description

代码语言:javascript
复制
array Imagick::getSize ( void )

Get the size in pixels associated with the Imagick object, previously set by Imagick::setSize().

Note: This method just returns the size that was set using Imagick::setSize(). If you want to get the actual width / height of the image, use Imagick::getImageWidth() and Imagick::getImageHeight().

Return Values

Returns the size associated with the Imagick object as an array with the keys "columns" and "rows".

Examples

Example #1 Getting the size of a raw RGB image set at 200x400, after scaling to 400x800 (compared to width / height)

代码语言:javascript
复制
<?php
//Set?size?first?and?then?load?the?raw?image
$img?=?new?Imagick();
$img->setSize(200,?400);
$img->readImage("image.rgb");

$img->scaleImage(400,?800);

$size?=?$img->getSize();
print_r($size);

echo?"$img->getImageWidth()."x".$img->getImageHeight();
?>

The above example will output:

代码语言:javascript
复制
Array
(
    [columns] => 200
    [rows] => 400
)
400x800

← Imagick::getSamplingFactors

Imagick::getSizeOffset →

代码语言:txt
复制
 ? 1997–2017 The PHP Documentation Group

Licensed under the Creative Commons Attribution License v3.0 or later.

扫码关注腾讯云开发者

领取腾讯云代金券

http://www.vxiaotou.com