public Image::width(): integer
Reading the width in pixels from an image instance.
use Intervention\Image\ImageManager;
// create new manager instance with desired driver
$manager = new ImageManager('gd');
// reading an image
$image = $manager->make('images/example.png');
// reading the image width
$width = $image->width();
public Image::width(): integer
Reading the pixel height from an image instance.
use Intervention\Image\ImageManager;
// create new manager instance with desired driver
$manager = new ImageManager('gd');
// reading an image
$image = $manager->make('images/example.png');
// reading the image height
$height = $image->height();
public Image::size(): SizeInterface
Reading the image size from an instance.
use Intervention\Image\ImageManager;
// create new manager instance with desired driver
$manager = new ImageManager('gd');
// reading an image
$image = $manager->make('images/example.png');
// reading image size
$size = $image->size();
// read aspect ratio
$ratio = $size->getAspectRatio();
2023-09-08 更新