furagu / easy-gd

A simplified Node.js wrapper around GD image manipulation library with extra features making your life easier.
MIT License
25 stars 14 forks source link

Read image dimension #6

Closed mhipo1364 closed 9 years ago

mhipo1364 commented 9 years ago

Hi

I need to read image dimension for validity. How can I access to image dimension ?

I can't access them using exif, so how can I do this?

furagu commented 9 years ago

Hey!

The library itself is a wrapper around node-gd, so everything you can find in the node-gd documentation is applicable to easy-gd as well.

Here is the way to get image dimensions:

var image = gd.open('my-image.jpeg') //could also be asynchronous with a callback

image.width
image.height
mhipo1364 commented 9 years ago

@furagu : Thanks man, saved my time so much :+1: