Kasper
Kasper

Reputation: 1292

PHP GD, imagecreatefromstring( ); how to get the image dimensions?

Normally I use imagecreatefromjpeg() and then getimagesize(), but with Firefox 3 I need to go round this different. So now im using imagecreatefromstring(), but how do I retreive the image dimensions now?

Upvotes: 11

Views: 8624

Answers (2)

PhiLho
PhiLho

Reputation: 41142

imagesx() and imagesy() functions seem to work with images made with imagecreatefromstring(), too.

Upvotes: 20

Kasper
Kasper

Reputation: 1292

ah yes! i just found the answer on the internet a second ago :)

for those who still interested :

$image = imagecreatefromstring($img_str);
$w = imagesx($image);
$h = imagesy($image);

Upvotes: 7

Related Questions