Emir
Emir

Reputation: 1586

PHP Get Image size when image is stored as byte array

I have image as binary string. (submitted via POST from C# app as byte array)

I can read it using imagecreatefromstring function. How can I get image size (width and height)?

getimagesize function takes filename as parametar. Is there alternative that can read image from binary string and return image size?

Upvotes: 4

Views: 1370

Answers (2)

Alex Ackerman
Alex Ackerman

Reputation: 1341

Try imagesx(); and imagesy();

Upvotes: 0

deceze
deceze

Reputation: 522016

You can use imagesx and imagesy on gd resources.

Upvotes: 4

Related Questions