I've tried to use the PHP function getimagesize, but I was unable to extract the image width and height as an integer value.
How can I achieve this?
Try like this:
list($width, $height) = getimagesize('path_to_image');
Make sure that:
Also try to prefix path with $_SERVER[DOCUMENT_ROOT]
, this helps sometimes when you are not able to read the files
list($width, $height) = getimagesize($filename)
Or,
$data = getimagesize($filename);
$width = $data[0];
$height = $data[1];