Get the width and height of the image in the frame

I have several images in a MySQL database, each of which is stored in BLOB fields. How to estimate the width and height of images in pixels?

+3
source share
1 answer

Let's say you got the image from the blob field in the database via mysqli_query and assigned it the $ image variable . You can use this code:

$im = imagecreatefromstring($image);
$width = imagesx($im);
$height = imagesy($im);
+1
source

All Articles