1. NodeBox 1
    1. Homepage
    2. NodeBox 3Node-based app for generative design and data visualization
    3. NodeBox OpenGLHardware-accelerated cross-platform graphics library
    4. NodeBox 1Generate 2D visuals using Python code (Mac OS X only)
  2. Gallery
  3. Documentation
  4. Forum
  5. Blog

Get an image resolution

Posted by ||< ||_ ||\/|| on May 13, 2008



Hi,

I'm wondering if there's a way to get the resoltution on an image.
Here's is my problem :
I wanna make an image layout with node box, and the images i'm using have different resolutions. For example this 2 squares are both 100px/100px, but the blue one is 72dpi and the green 300dpi. As you can see, they aren't displayed at the same size which is quite a problem for what i'm doing. But if i can get the resolution of my image, i'll be able to scale it in proportion.

I hope you got what i mean and someone will be able to give me a solution to this problem.

Thanx anyway.


 
Posted by anonymous on May 14, 2008

This message has been repeated because, apparently, the server blocked it.
I'd recommend taking a look at the imagesize() function, which returns the pixel dimensions of an image. You could use that in conjunction with image()'s width and height parameters to trick NB into rendering all of the image's pixels.