getOriginalSize() crashes when fed a .gif

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
magicaxis
Posts: 12
Joined: Sun Jan 08, 2012 4:19 am

getOriginalSize() crashes when fed a .gif

Post by magicaxis »

Hiya.

I'm making several objects with images for textures. pngs, jpgs, bmps, they all work fine. but when a gif goes through my code it crashes out. it says the error is here:

Code: Select all

        picture->setScale(core::vector3df(
                1,
                picture->getMaterial(0).getTexture(0)->getOriginalSize().Height/scaledown,
                picture->getMaterial(0).getTexture(0)->getOriginalSize().Width/scaledown));
Specifically it says the error is in the last line of that code.

Does anyone know why .gifs would cause such a ruckus?

What can I do to allow a gif to work? Bear in mind that these .gifs are NOT animated.
CuteAlien
Admin
Posts: 9933
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: getOriginalSize() crashes when fed a .gif

Post by CuteAlien »

I also have no idea. Could you give us more information. For example what kind of type is picture? Or post a complete example to reproduce it. And add the gif that fails.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
magicaxis
Posts: 12
Joined: Sun Jan 08, 2012 4:19 am

Re: getOriginalSize() crashes when fed a .gif

Post by magicaxis »

I have tried several gifs, and they all crash the program at that place. Is there anything special about gifs im unaware of?
CuteAlien
Admin
Posts: 9933
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: getOriginalSize() crashes when fed a .gif

Post by CuteAlien »

Well, tell us at least what picture is in your case. IGUIImage has no scale - is this a billboardscenode? Or some own class? Also which compiler, which OS and 32-bit or 64-bit?

edit: OK, forget it - I managed to reproduce it. Have to check it in the evening.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
magicaxis
Posts: 12
Joined: Sun Jan 08, 2012 4:19 am

Re: getOriginalSize() crashes when fed a .gif

Post by magicaxis »

oh sorry :( windows 7, picture is an IMeshScene Node*, and it is within the class "Pictureframe".
CuteAlien
Admin
Posts: 9933
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: getOriginalSize() crashes when fed a .gif

Post by CuteAlien »

Ehm - check for NULL, the crash is not the function but because the image never loaded. The reason being that we have no support for gif-loading in Irrlicht. So either convert your images to another image-format ... or write a gif-loader.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
magicaxis
Posts: 12
Joined: Sun Jan 08, 2012 4:19 am

Re: getOriginalSize() crashes when fed a .gif

Post by magicaxis »

Aah, i was afraid of that. Thank you :D
Post Reply