Getting image dimesions without device - possible?

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
Clash
Posts: 80
Joined: Thu Apr 19, 2007 4:20 pm

Getting image dimesions without device - possible?

Post by Clash »

Hello guys!
I have a client and a server application, the server needs a way to read the dimensions of images but I don't want it to be too memory intensive, so I didn't plan on using irrlicht for it... is there anyway I can get the image dimensions with irrlicht or maybe another library and not consuming a lot of memory? With irrlicht my prog uses about 230mb and without it 13mb

Is it the device created by createDevice(), the drawing, what is it that consumes a lot of memory? Can I avoid it and be able to get the image dimensions?

THANKS A LOT in advance
jpoag
Posts: 25
Joined: Mon Aug 10, 2009 1:00 am

Post by jpoag »

The dimensions of an image file? Do you know the format of the file?

I can think of a couple libraries to use. Image Magick, libpng, etc... Really, you only need to read the headers of the images. If this is the case, you can find Structs on the net (or on ports) for the formats of the images you want to support, then it's as simple as opening the file, reading the header into the struct and then closing the file.

If that's too much, then you can install image magick and read the info from the header and pipe it back into your program. (Image magick also has MagicWand for a C interface, but I think that violates the 'low memory' requirement).

Also, did you try creating a NULL device and checking your memory usage?
-James
Post Reply