webCOMAND

ImageData::get_width()

Get the width of the image in pixels.

Prototype

int get_width()

Return

The width of the image in pixels.

Example

// load a PNG image from the web
$url = 'https://www.webcomand.com/docs/img/note.png';
$data = get_file_contents($url);
$image = new \io_comand_image\models\ImageData($data);

$width = $image->get_width();
echo("Image Width: $width\n");